#include <iostream>
#include <algorithm>
#include<unordered_map>//哈希表头文件
using namespace std;
unordered_map<int,bool> hashTable;//简历一个哈希表
int main() {
int n, m, f = 0;
cin >> n;
int a[100];
for (int i = 0; i < n; ++i) {
cin >> a[i];
hashTable[a[i]] = true;
}
cin >> m;
for (int i = 0; i < m; ++i) {
int target;
cin>>target;
if(hashTable[target]){
std::cout<<"YES"<<std::endl;
}else{
std::cout<<"NO"<<std::endl;
}
}
}

京公网安备 11010502036488号