#include <bits/stdc++.h>
#include <unordered_map>

using namespace std;

const int maxn = 1000 + 10;
const int raxn = 1e6;
unordered_map<int,bool> HashTable; 

int n,m;
int a[maxn];
bool hashTable[raxn];


int main(){
	cin >> n;
	
	for(int i = 0;i < n;i ++){
		cin >> a[i];
		//hashTable[a[i]] = true;
		HashTable[a[i]] = true;
	}
	
	sort(a,a + n);
	
	cin >> m;
	while(m --){
		int x;
		cin >> x;
		if(HashTable[x]){
			cout << "YES" << endl;
		}else{
			cout << "NO" << endl;
		}
	}
	return 0;
}