#include <set>
#include <vector>
#include <iostream>
using namespace std;
int main(){
int n, m;
cin >> n;
set<int> a;
vector<int> b;
for(int i = 0; i < n; ++ i) {
int tmp;
cin >> tmp;
a.insert(tmp);
}
cin >> m;
for(int i = 0; i < m; ++ i){
int tmp;
cin >> tmp;
b.push_back(tmp);
}
for(int i = 0; i < m; ++ i)
if(a.count(b[i])) cout << "YES" << endl;
else cout << "NO" << endl;
return 0;
}