#include <iostream>

using namespace std;

int main() {
    int n;
    while (scanf("%d", &n) != EOF) {
        int arr[n];
        for (int i = 0; i < n; i++) {
            scanf("%d", &arr[i]);
        }
        int m;
        scanf("%d", &m);
        for (int j = 0; j < m; j++) {
            int x;
            int tag = -1;
            scanf("%d", &x);
            for (int i = 0; i < n; i++) {
                if (x == arr[i]) {
                    tag = 1;
                    printf("YES\n");
                    break;
                }
            }
            if (tag == -1) {
                printf("NO\n");
            }

        }
    }
}