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

int main(){
	ios::sync_with_stdio(0); cin.tie(0);
    cout.tie(0);
	int N, Q;
	cin >> N >> Q;
	int a[N];
	for(int i = 0; i < N; i++) cin >> a[i];
	
	while(Q--){
		int t; cin >> t;
		bool ex = false;
		int sm = 0, vc = 0;
		for(int i = 0; i < N; i++){
			if(a[i] < t) sm++;
			else if(a[i] > t) vc++;
			else ex = true;
		}
		int res = !ex;
		if(sm <= vc){
			res += abs(sm - vc);
		}
		else{
			res += sm - vc - 1;
		}
		cout << res << endl;
	}
	return 0;
}