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

int main(){
	ios::sync_with_stdio(0); cin.tie(0);
	int N, Q;
	cin >> N >> Q;
	vector<int> a(N);
	for(int i = 0; i < N; i++) cin >> a[i];
	sort(a.begin(), a.end());
	
	while(Q--){
		int t; cin >> t;
		bool ex = false;
		int sm, vc;
		sm = lower_bound(a.begin(), a.end(), t) - a.begin();
		ex = a[sm] == t;
		vc = a.end() - upper_bound(a.begin() + sm, a.end(), t);
		cerr << "SM: " << sm << " | VC: "<< vc << endl;
		int res = !ex;
		if(sm <= vc){
			res += abs(sm - vc);
		}
		else{
			res += sm - vc - 1;
		}
		cout << res << endl;
	}
	return 0;
}