#include "cstdio"
#include "map"

using namespace std;


int main() {
    int n, m;
    scanf("%d", &n);
    int arr[n + 1];
    map<int, int> findIndex;
    for (int i = 0; i < n; ++i) {
        scanf("%d", &arr[i]);
        findIndex[arr[i]] = i;  // key 是元素 value是下标
    }
    scanf("%d", &m);
    int x;
    for (int i = 0; i < m; ++i) {
        scanf("%d", &x);
        if (findIndex.find(x) == findIndex.end()) {
            printf("NO\n");
        } else {
            printf("YES\n");
        }
    }
    return 0;
}