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

int minNumber(int a[], int n, int x){
	int l = 0, h = 0, e = 0;
	for (int i = 0; i < n; i++){
		if (a[i] == x) e++;
		else if (a[i] > x) h++;
		else if (a[i] < x) l++;
	}
	int ans = 0;
	if (l > h) ans = l - h;
	else if (l < h) ans = h - l - 1;
	return ans + 1 - e;
}
int main()
{
	int x, y;
    cin >> x >> y;
    int a[x];
    for (int i = 0; i < x; i++)
        cin >> a[i];
    for (int i = 0; i < y; i++){
        int joj;
        cin >> joj;
        int j = minNumber(a, x, joj);
        if (j != 0) j--;
        cout << j << endl;
    }
	return 0;
}