#include<stdio.h>
#include<stdlib.h>
//#include<algorithm>
//using namespace std;
int qiu[1000002];
int cha[100002];
int cmp(const void *a,const void *b)
{
return *(int *)a-*(int *)b;
}
int main()
{
int n,m;
scanf("%d%d",&m,&n);
{
int t,i,j,top,low,k,count;
for(i=0;i<m;i++)
scanf("%d",&qiu[i]);
//sort(qiu,qiu+m);
qsort(qiu,m,sizeof(qiu[0]),cmp);
for(k=0,i=0;i<n;i++)
{
scanf("%d",&t);
count=low=0;
top=m-1;
j=(top+low)/2;
while(low<=top)
{
if(t==qiu[j])
{
count=1;
break;
}
else if(t<qiu[j])
{
top=j-1;
j=(top+low)/2;
}
else if(t>qiu[j])
{
low=j+1;
j=(top+low)/2;
}
}
count==1?printf("YES\n"):printf("NO\n");
}
}
return 0;
}