#include <stdio.h>

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);
        int Brr[m];
        for (int j = 0; j < m; j++) {
            scanf("%d", &Brr[j]);
        }
        for (int k = 0; k < m; k++) {
            int l;
            for (l = 0; l < n; l++) {
                if (Brr[k] == Arr[l]) {
                    printf("YES\n");
                    break;
                }
            }
            if (l == n) {
                printf("NO\n");
            }
        }
    }
    return 0;
}