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

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);
for(int i=0; i<n; i++)cin >> a[i];
//int n = sizeof(a) / sizeof(a[0]);
for(int i=0; i<q; i++){
    cin >> x;
cout << minNumber(a, n, x) << endl;
}
return 0;
}