#include<bits/stdc++.h>

using namespace std;

main ()
{
    int n,q;
    cin >> n >> q;
    vector <int> a(n);
    vector <int> b(q);

    for(int i = 0;i < n;i++)
        cin >> a[i];
    for(int i = 0;i < q;i++)
        cin >> b[i];

    sort(a.begin(), a.end());

    int j = 0;

    for(int i = 0; i < q; i++)
    {
		auto it = lower_bound(a.begin(), a.end(), b[i]);
		int index = ((it - a.begin()));
		if(index < (n + 1) / 2)
			cout << n - (2*index) - 1 << endl;
		else
			cout << (2*index) - n << endl;
    }
}