#include<bits/stdc++.h>
using namespace std;
int N,Q,A[200005],B[200005],a,b,c,l,r,m,pok1,pok2,sol;
int main(){
  cin>>N>>Q;
  for(int i=1; i<=N; i++)cin>>A[i];
  for(int i=1; i<=Q; i++)cin>>B[i];
  sort(A+1,A+1+N);
  for(int i=1; i<=Q; i++){
    l=1;
    r=N;
    while(l<=r){
      m=(l+r)/2;
      if(A[m]>=B[i])r=m-1;
      else l=m+1;
    }
    pok1=r;
    l=1;
    r=N;
    while(l<=r){
      m=(l+r)/2;
      if(A[m]>B[i])r=m-1;
      else l=m+1;
    }
    pok2=l;
    a=pok1;
    c=N-pok2+1;
    b=N-a-c;
    if(b==0){
      if(a==c)sol=1;
      if(a<c)sol=c-a+1;
      if(a>c)sol=a-c;
    }
    if(b!=0){
      sol=0;
      if(a+b<c)sol=c-(a+b)+1;
      if(a>c+b)sol=a-(c+b);
    }
    cout<<sol<<endl;
  }
  return 0;
}