#include<iostream>
#include<cstdio>
#include<algorithm>
using namespace std;
bool Find(int a[],int n,int target){
int left=0;
int right=n-1;
while(left<=right){
int middle=(left+right)/2;
if(a[middle]<target){
left=middle+1;
}else if(a[middle]>target){
right=middle-1;
}else{
return true;
}
}
return false;
};
int main()
{
int n,arr[100];
while(cin>>n){
for(int i=0;i<n;i++){
cin>>arr[i];
}
sort(arr,arr+n);
int m;
cin>>m;
for(int i=0;i<m;i++){
int x;
cin>>x;
if(Find(arr,n,x)){
cout<<"YES"<<endl;
}else{
cout<<"NO"<<endl;
}
}
}
return 0;
}
#include<cstdio>
#include<algorithm>
using namespace std;
bool Find(int a[],int n,int target){
int left=0;
int right=n-1;
while(left<=right){
int middle=(left+right)/2;
if(a[middle]<target){
left=middle+1;
}else if(a[middle]>target){
right=middle-1;
}else{
return true;
}
}
return false;
};
int main()
{
int n,arr[100];
while(cin>>n){
for(int i=0;i<n;i++){
cin>>arr[i];
}
sort(arr,arr+n);
int m;
cin>>m;
for(int i=0;i<m;i++){
int x;
cin>>x;
if(Find(arr,n,x)){
cout<<"YES"<<endl;
}else{
cout<<"NO"<<endl;
}
}
}
return 0;
}