#include <bits/stdc++.h>
using namespace std;
int main(){
	ios::sync_with_stdio(false);cin.tie(0);
	int n, q;
	cin >> n >> q;
	int a[n];
	int b[q];
	for(int i = 0; i < n; i++){
		cin>>a[i];
	}
	sort(a, a+n);
	for(int i = 0; i < q; i++){
		cin>>b[i];
	}
	for(int i = 0; i < q; i++){
		int manjihOd = lower_bound(a, a+n, b[i])-a;
		int resenje = -1;
		if(manjihOd <= n/2 && n%2 == 0)
			resenje = abs(n-1 - 2*manjihOd);
		else if(manjihOd > n/2 && n%2 == 0)
			resenje = abs(n-2*manjihOd);
		else if(manjihOd <= n/2 && n%2 == 1)
			resenje = abs(n-1-2*manjihOd);
		else if(manjihOd > n/2 && n%2 == 1){
			resenje = abs(n-2*manjihOd);
		}
		cout<<resenje<<endl;
	}
}