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

// Function to perform binary search on the sorted array
bool binarySearch(const vector<int>& arr, int target) {
    int low = 0;
    int high = arr.size() - 1;
    
    while (low <= high) {
        int mid = low + (high - low) / 2;
        
        if (arr[mid] == target) {
            return true;
        }
        if (arr[mid] < target) {
            low = mid + 1;
        } else {
            high = mid - 1;
        }
    }
    
    return false;
}

int main() {
    int n, k;
    cin >> n >> k;
    
    // Input the first array (sorted)
    vector<int> firstArray(n);
    for (int i = 0; i < n; ++i) {
        cin >> firstArray[i];
    }
    
    // Input the second array (numbers to search for)
    vector<int> secondArray(k);
    for (int i = 0; i < k; ++i) {
        cin >> secondArray[i];
    }
    
    // For each element in the second array, perform binary search on the first array
    for (int i = 0; i < k; ++i) {
        if (binarySearch(firstArray, secondArray[i])) {
            cout << "YES" << endl;
        } else {
            cout << "NO" << endl;
        }
    }

    return 0;
}
