#include <bits/stdc++.h>
using namespace std;


#define MAX 9999995
vector<int> FWT(MAX,0);
void ubaci(int x, int koliko)
{
 for (;x< MAX;x+=x&-x) FWT[x]+=koliko;
}
int upit(int x)
{
 int rez=0;
 for (;x>0;x-=x&-x) rez+= FWT[x];
 return rez;
}

int minNumber(vector<int> a, int n, int x)
{
int manji = 0, veci = 0, e = 0;
for (int i = 0; i < n; i++) {

if (a[i] == x)
e++;

else if (a[i] > x)
veci++;

else if (a[i] < x)
manji++;
}


int res = 0;
if (manji > veci)
res = manji - veci;
else if (manji < veci)
res = veci - manji;

if (e!=0)   res -= e;
if (res<0) res=0;
if(e!=0){
    if(manji+e<=veci)res++;
}
if(e==0){
    if(manji*veci!=0 and manji<veci)res++;
if (manji==0 and veci!=0)res=n+1;
if (manji!=0 and veci==0)res=n;
if (manji==0 and veci==0)res=n;
}
   return res;
}

int main()
{
    ios_base::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
int x;
int n,q;
cin >> n >> q;
vector<int> a(n);

if (n*q<=10000000)
{

    for(int i=0; i<n; i++)cin >> a[i];
    for(int i=0; i<q; i++){
       cin >> x;
       cout << minNumber(a, n, x) << '\n';
}
}

else
    {
        int br0=0;
        int res = 0;
	for(int i=0; i<n; i++)
    {
        cin >> a[i];
        if(a[i]==0)br0++;
        a[i]++;
        ubaci(a[i],1);
    }
	for(int i=0; i<q; i++){
        int x;
        cin >> x;
        x++;
       int manji=0,veci=0,e=0;
       int manjijednak=upit(x);

       if (x>2)
          e=manjijednak-upit(x-1);
       else if (x==2)
           e=manjijednak-br0;
       else if (x==1)
            e=br0;
       veci=n-manjijednak;
       manji=manjijednak-e;


       if (manji > veci)   res = manji - veci;
       else if (manji < veci)
                res = veci - manji;

    if (e!=0)   res -= e;
    if (res<0) res=0;
    if(e!=0){
    if(manji+e<=veci)res++;
     }
    if(e==0){
    if(manji*veci!=0 and manji<veci)res++;
    if (manji==0 and veci!=0)res=n+1;
    if (manji!=0 and veci==0)res=n;
    if (manji==0 and veci==0)res=n;
       }
    }

   cout << res << '\n';
}

return 0;
}