//采用map容器的做法
#include "stdio.h"
#include "map"
using namespace std;
int main(){
map<int,int> findNum;
int n,m;
int arr[100];
int Num;
while (scanf("%d",&n)!=EOF){
for (int i = 0; i < n; ++i) {
scanf("%d",arr+i);
findNum[arr[i]]=i;
}
scanf("%d",&m);
for (int i = 0; i < m; ++i) {
scanf("%d",&Num);
if(findNum.find(Num)==findNum.end())
printf("NO\n");
else
printf("YES\n");
}
}
}