#include<iostream> #include<algorithm> using namespace std; int main() { int n,num,x; while (cin >> n) { int arr[n]; for (int i = 0; i < n; i++) { cin >> arr[i]; } cin >> num; for (int i = 0; i < num; i++) { int j; cin >> x; for ( j = 0; j < n; j++) { if (arr[j] == x) { printf("YES\n"); break; } } if (j == n) { printf("NO\n"); } } } return 0; }