#include <bits/stdc++.h>

using namespace std;

const int maxn = 1000 + 10;

int n,m;
int a[maxn];

bool BinarySearch(int n,int x){
	int l = 0,r = n - 1;
	while(l <= r){
		int m = (r + l) / 2;
		if(a[m] < x){
			l = m + 1;
		}else if(a[m] > x){
			r = m - 1;
		}else{
			return true;
		}
	}
	return false;
}

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;
		if(BinarySearch(n,x)){
			cout << "YES" << endl;
		}else{
			cout << "NO" << endl;
		}
	}
	return 0;
}