#include <iostream> #include <algorithm> using namespace std; int arr[100+10]; // string BinarySearch(int n,int number){ // int left = 0; // int right = n-1; // while(left<=right){ // int middle = (left+right) / 2; // if(number > arr[middle]){ // left = middle+1; // }else if(number<arr[middle]){ // right = middle -1; // }else{ // return "YES"; // } // } // return "NO"; // } int main() { int n; cin >> n; for (int i = 0; i < n; i++) { cin >> arr[i]; } sort(arr,arr+n); int m; cin >> m; int num[m]; for (int i = 0; i < m; i++) { cin >> num[i]; } for (int i = 0; i < m; i++) { int number = num[i]; int position = lower_bound(arr, arr+n, number) - arr; if(position!=n&&arr[position]==number){ cout<<"YES"<<endl; }else{ cout<<"NO"<<endl; } // string str = BinarySearch(n,number); // cout<<str<<endl; } }