#include<stdlib.h>
#include<iostream>
#include<algorithm>
#include<stdio.h>
using namespace std;
int a[1000010];
int main()
{
int n1, n2, i;
int temp1, temp2, m, n, flag1;
scanf("%d%d", &n1, &n2);
for(i = 0; i < n1; i++){
scanf("%d", &a[i]);
}
sort(a, a + n1);
for(i = 0; i < n2; i++){
scanf("%d", &temp1);
flag1 = 0;
m = 0;
n = n1 - 1;
while(m <= n){
temp2 = (m + n) / 2;
if(temp1 == a[temp2]){
flag1 = 1;
printf("YES\n");
break;
}
else if(temp1 > a[temp2]){
m = temp2 + 1;
}
else if(temp1 < a[temp2]){
n = temp2 - 1;
}
}
if(flag1 == 0){
printf("NO\n");
}
}
return 0;
}
#include<iostream>
#include<algorithm>
#include<stdio.h>
using namespace std;
int a[1000010];
int main()
{
int n1, n2, i;
int temp1, temp2, m, n, flag1;
scanf("%d%d", &n1, &n2);
for(i = 0; i < n1; i++){
scanf("%d", &a[i]);
}
sort(a, a + n1);
for(i = 0; i < n2; i++){
scanf("%d", &temp1);
flag1 = 0;
m = 0;
n = n1 - 1;
while(m <= n){
temp2 = (m + n) / 2;
if(temp1 == a[temp2]){
flag1 = 1;
printf("YES\n");
break;
}
else if(temp1 > a[temp2]){
m = temp2 + 1;
}
else if(temp1 < a[temp2]){
n = temp2 - 1;
}
}
if(flag1 == 0){
printf("NO\n");
}
}
return 0;
}