#include <bits/stdc++.h> using namespace std; const int maxn = 1000 + 10; const int raxn = 1e6; int n,m; int a[maxn]; bool hashTable[raxn]; int main(){ cin >> n; for(int i = 0;i < n;i ++){ cin >> a[i]; hashTable[a[i]] = true; } sort(a,a + n); cin >> m; while(m --){ int x; cin >> x; if(hashTable[x]){ cout << "YES" << endl; }else{ cout << "NO" << endl; } } return 0; }