#include <bits/stdc++.h>
using namespace std;
int N,Q,x;
vector <int> K;
int func(int x){
int R=1,L=K[N];
int W=log2(K[N]);
int temp;
for(int n=1;n<=W;n++){
temp=(R+L)/2;
if(K[temp]==x){
return temp%2==0;
}else if(K[temp]>x){
R=temp;
}else{ //K[temp]<x
L=temp;
}
}
if(K[L+1]!=K[R]){
temp=(R+L)/2;
if(K[temp]==x){
return temp%2==0;
}else if(K[temp]>x){
R=temp;
}else{ //K[temp]<x
L=temp;
}
}
return L%2==0;
}
int main() {
cin>>N>>Q;
for(int n=1;n<=N;n++){
cin>>x;
K.push_back(x);
}
sort(K.begin(),K.end());
/*for(int n=0;n<N;n++){
cout<<K[n];
}*/
while(cin>>x){
cout<<func(x)<<"\n";
}
}
I2luY2x1ZGUgPGJpdHMvc3RkYysrLmg+CnVzaW5nIG5hbWVzcGFjZSBzdGQ7CmludCBOLFEseDsKdmVjdG9yIDxpbnQ+IEs7CmludCBmdW5jKGludCB4KXsKCWludCBSPTEsTD1LW05dOwoJaW50IFc9bG9nMihLW05dKTsKCWludCB0ZW1wOwoJZm9yKGludCBuPTE7bjw9VztuKyspewoJCXRlbXA9KFIrTCkvMjsKCQlpZihLW3RlbXBdPT14KXsKCQkJcmV0dXJuIHRlbXAlMj09MDsKCQl9ZWxzZSBpZihLW3RlbXBdPngpewoJCQlSPXRlbXA7CgkJfWVsc2V7IC8vS1t0ZW1wXTx4CgkJCUw9dGVtcDsKCQl9Cgl9CglpZihLW0wrMV0hPUtbUl0pewoJCXRlbXA9KFIrTCkvMjsKCQlpZihLW3RlbXBdPT14KXsKCQkJcmV0dXJuIHRlbXAlMj09MDsKCQl9ZWxzZSBpZihLW3RlbXBdPngpewoJCQlSPXRlbXA7CgkJfWVsc2V7IC8vS1t0ZW1wXTx4CgkJCUw9dGVtcDsKCQl9Cgl9CglyZXR1cm4gTCUyPT0wOwp9CgoKaW50IG1haW4oKSB7CgljaW4+Pk4+PlE7Cglmb3IoaW50IG49MTtuPD1OO24rKyl7CgkJY2luPj54OwoJCUsucHVzaF9iYWNrKHgpOwoJfQoJc29ydChLLmJlZ2luKCksSy5lbmQoKSk7CgkvKmZvcihpbnQgbj0wO248TjtuKyspewoJCWNvdXQ8PEtbbl07Cgl9Ki8KCXdoaWxlKGNpbj4+eCl7CgkJY291dDw8ZnVuYyh4KTw8IlxuIjsKCX0KfQ==