#include <bits/stdc++.h>

using namespace std;

const int maxn = 1000 + 10;

int n,m;
int a[maxn];


int main(){
	cin >> n;
	
	for(int i = 0;i < n;i ++){
		cin >> a[i];
	}
	
	sort(a,a + n);
	
	cin >> m;
	while(m --){
		int x;
		cin >> x;
		int position = lower_bound(a,a + n,x) - a; // 地址,数组下标 
		if(position != n && a[position] == x){
			cout << "YES" << endl;
		}else{
			cout << "NO" << endl;
		}
	}
	return 0;
}