#include <iostream>

using namespace std;

const int maxn = 1000 + 10;

int n,m;
int arr[maxn];

bool LinearFind(int n,int x){
	for(int i = 0;i < n;i ++){
		if(x == arr[i]){
			return true;
		}
	}
	return false;
}

int main(){
	cin >> n;
	
	for(int i = 0;i < n;i ++){
		cin >> arr[i];
	}
	
	cin >> m;
	while(m --){
		int x;
		cin >> x;
		if(LinearFind(n,x)){
			cout << "YES" << endl;
		}else{
			cout << "NO" << endl;
		}
	}
	return 0;
}