#include <iostream>
using namespace std;
int bin_s(int a[],int x, int n){
int l=0,r=n-1, m;
while(l<r){
m=(l+r)/2;
if(x>a[m])
l=m+1;
else r=m;
}
return 1;
}
int main(){
int n, k;
cin>>n>>k;
int a[n];
for (int i=0; i<n; i++)
cin>>a[i];
for (int i=0; i<k; i++){
int x;
cin>>x;
int l=0, r=n-1;
while(l<r){
int m=(l+r)/2;
if(a[m]<x)
l=m+1;
else r=m;
}
if(x==a[l])cout<<"YES"<<endl;
else cout<<"NO"<<endl;
}
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoJaW50IGJpbl9zKGludCBhW10saW50IHgsIGludCBuKXsKCQlpbnQgbD0wLHI9bi0xLCBtOwoJCXdoaWxlKGw8cil7CgkJCW09KGwrcikvMjsKCQkJaWYoeD5hW21dKQoJCQlsPW0rMTsKCQllbHNlIHI9bTsKCQl9CgkJcmV0dXJuIDE7Cgl9CmludCBtYWluKCl7CglpbnQgbiwgazsKCWNpbj4+bj4+azsKCWludCBhW25dOwoJZm9yIChpbnQgaT0wOyBpPG47IGkrKykKCQljaW4+PmFbaV07Cglmb3IgKGludCBpPTA7IGk8azsgaSsrKXsKCQlpbnQgeDsKCQljaW4+Png7CgkJaW50IGw9MCwgcj1uLTE7CgkJd2hpbGUobDxyKXsKCQkJaW50IG09KGwrcikvMjsKCQkJaWYoYVttXTx4KQoJCQlsPW0rMTsKCQllbHNlIHI9bTsKCQl9CgkJaWYoeD09YVtsXSljb3V0PDwiWUVTIjw8ZW5kbDsKCQllbHNlIGNvdXQ8PCJOTyI8PGVuZGw7Cgl9CglyZXR1cm4gMDsKfQ==