#include <bits/stdc++.h>
using namespace std;
int main() {
int n,m;
cin>>n;
int arr[n];
for(int i =0;i<n;i++)cin>>arr[i];
cin>>m;
while(m--){
int temp;cin>>temp;
if(find(arr,arr+n,temp)!=arr+n)cout<<"YES"<<endl;
else cout<<"NO"<<endl;
}
}
// 64 位输出请用 printf("%lld")
还是set好用

京公网安备 11010502036488号