#include <iostream>
using namespace std;
int a[100];//定义数组
bool LinearSearch(int n, int target) {//线性查找函数
    bool flag = false;//标志
    for (int i = 0; i < n; ++i) {
        if (a[i] == target) {
            flag = true;
            break;//结束***
        }
    }
    return flag;//不要忘记返回值
}

int main() {
    int n, m, f = 0;
    cin >> n;
    
    for (int i = 0; i < n; ++i) {
        cin >> a[i];
    }
    cin >> m;
    for (int i = 0; i < m; ++i) {
        int target;
        cin >> target;
        if (LinearSearch(n, target)) {
            std::cout << "YES" << std::endl;
        } else {
            std::cout << "NO" << std::endl;
        }
    }
    return 0;
}