#include <iostream>
#include <map>
using namespace std;

int main() {
    int n,m;
    cin>>n;
    map<int,bool> mp;
    while(n--){
        int temp;
        cin>>temp;
        mp[temp]=true;
    }
    cin>>m;
    while(m--){
        int temp;
        cin>>temp;
        if(mp.find(temp)!=mp.end()) cout<<"YES"<<endl;
        else cout<<"NO"<<endl;
    }
}
// 64 位输出请用 printf("%lld")