import java.util.*;
import java.lang.*;
import java.io.*;
class Main {
public static boolean find(int search, int[] arr, int len) {
boolean ret = false;
int fst = 0;
int lst = len - 1;
while (fst <= lst) {
int mid = (fst + lst) / 2;
if (search == arr[mid]) {
ret = true;
break;
} else if (search < arr[mid]) {
lst = mid - 1;
} else {
fst = mid + 1;
}
}
return ret;
}
public static void main
(String[] args
) { Scanner scan
= new Scanner
(System.
in); int len = scan.nextInt();
int[] arr = new int[len];
int i;
for (i = 0; i < len; i++) {
arr[i] = scan.nextInt();
}
int num = scan.nextInt();
int search;
for (i = 0; i < num; i++) {
search = scan.nextInt();
System.
out.
print((find
(search, arr, len
))? "YES\n" : "NO\n"); }
}
}
aW1wb3J0IGphdmEudXRpbC4qOwppbXBvcnQgamF2YS5sYW5nLio7CmltcG9ydCBqYXZhLmlvLio7CgpjbGFzcyBNYWluIHsKCXB1YmxpYyBzdGF0aWMgYm9vbGVhbiBmaW5kKGludCBzZWFyY2gsIGludFtdIGFyciwgaW50IGxlbikgewoJCWJvb2xlYW4gcmV0ID0gZmFsc2U7CgkJaW50IGZzdCA9IDA7CgkJaW50IGxzdCA9IGxlbiAtIDE7CgkJd2hpbGUgKGZzdCA8PSBsc3QpIHsKCQkJaW50IG1pZCA9IChmc3QgKyBsc3QpIC8gMjsKCQkJaWYgKHNlYXJjaCA9PSBhcnJbbWlkXSkgewoJCQkJcmV0ID0gdHJ1ZTsKCQkJCWJyZWFrOwoJCQl9IGVsc2UgaWYgKHNlYXJjaCA8IGFyclttaWRdKSB7CgkJCQlsc3QgPSBtaWQgLSAxOwoJCQl9IGVsc2UgewoJCQkJZnN0ID0gbWlkICsgMTsKCQkJfQoJCX0KCQlyZXR1cm4gcmV0OwoJfQoJCglwdWJsaWMgc3RhdGljIHZvaWQgbWFpbihTdHJpbmdbXSBhcmdzKSB7CgkJU2Nhbm5lciBzY2FuID0gbmV3IFNjYW5uZXIoU3lzdGVtLmluKTsKCQlpbnQgbGVuID0gc2Nhbi5uZXh0SW50KCk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