#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cstring>

using namespace std;

const int RANGE = 1e6;

const int MAXN = 100 + 10;

int arr[MAXN];

bool hashTable[RANGE];    //散列表,true表示index = value,反之,index != value


int main() {
	int n;
	scanf("%d",&n);
	for(int i = 0; i < n; ++i) {
		scanf("%d",&arr[i]);
		hashTable[arr[i]] = true;
	}
	int m;
	scanf("%d",&m);
	while(m--) {
		int target;
		scanf("%d",&target);
		if(hashTable[target]) {
			printf("YES\n");
		} else {
			printf("NO\n");
		}
	}
	return 0;
}