#include<cstdio>
#include<map>
#include<algorithm>
using namespace std;

int main() {
    map< int, int >findindx;
    int m, n ;
    int arr[200];
    while (scanf("%d", &n) != EOF) {
        for (int i = 0 ; i < n ; ++ i) {
            scanf("%d", &arr[i]);
            findindx[arr[i]] = i ;
        }
        scanf("%d", &m);
        for (int i = 0 ; i < m ; ++ i ) {
            int x;
            scanf("%d", &x);
            //
            if (findindx.find(x) == findindx.end()) {
                printf("NO\n");
            } else {
                printf("YES\n");
            }
        }
    }

}