#include <cstdio> #include <iostream> #include<string> #include<cstring> #include<cmath> #include<algorithm> using namespace std; int n; int a[105]; int m; int x; bool erfen(int a[],int b) { int low=0; int mid; int high=n-1; while(low<=high) { mid=(low+high)/2; if(b==a[mid]) return true; else if(b>a[mid]) { low=mid+1; } else if(b<a[mid]) { high=mid-1; } } return false; //一开始忘记写了!!一定要写上!!! } int main() { while(cin>>n) { int flag=0; for(int i=0;i<n;i++) cin>>a[i]; sort(a,a+n); cin>>m; for(int i=0;i<m;i++) { cin>>x; if(erfen(a,x)) cout<<"YES"<<endl; else cout<<"NO"<<endl; } } return 0; }