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

int main() {
    int n;
    cin >> n;
    vector<int> a(n);
    for (int i = 0; i < n; i++)    cin >> a[i];
    int m;
    cin >> m;
    vector<int> b(m);
    for (int i = 0; i < m; i++)    cin >> b[i];
    bool flag;
    for (int i = 0; i < m; i++) {
        flag = false;
        for (int j = 0; j < n; j++) {
            if (a[j] == b[i])  flag = true;
        }
        if (flag)    cout << "YES" << endl;
        else    cout << "NO" << endl;
    }
}
// 64 位输出请用 printf("%lld")