#include <bits/stdc++.h>
#define pb push_back
#define yes cout << "YES\n"
#define no cout << "NO\n"
#define ll long long
using namespace std;
 
 
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    ll n,q,br1=0,br=0,br2=0;cin>>n>>q;vector<ll>vec(n),vec1(q);
    for(ll i=0;i<n;i++){
    	cin>>vec[i];
	}
	for(ll i=0;i<q;i++){
		cin>>vec1[i];
	}
	for(ll i=0;i<q;i++){
		br=0;
		br1=0,br2=0;
		for(ll j=0;j<n;j++){
			if(vec1[i]>vec[j])br++;
			else if(vec1[i]==vec[j])br2++;
			else br1++;
		}
		if(br2==0){
			if(br1==br)cout<<1<<endl;
			else if(br1>br)cout<<br1-br+1<<endl;
			else cout<<br-br1<<endl;
		}
		else if(br>br1 && br-br1>=br2)cout<<br-br1-br2<<endl;
		else if(br1>br && br1-br>=br2)cout<<br1-br-br2+1<<endl;
		else if(br1==br)cout<<0<<endl;
		else if(br>br1 && br-br1<br2 && (br2-(br-br1))%2==1)cout<<0<<endl;
		else if(br>br1 && br-br1<br2 && (br2-(br-br1))%2==0)cout<<0<<endl;
		else if(br1>br && br1-br<br2 && (br2-(br1-br))%2==0)cout<<0<<endl;
		else if(br1>br && br1-br<br2 && (br2-(br1-br))%2==1)cout<<0<<endl;
		
	}
	
	return 0;
}