#include <iostream>
#include <cmath>
//#include <bits/stdc++.h>
#include<algorithm>
using namespace std;
 
int main()
{
	int n, q;
	
	cin >> n >> q;
 
	int* nizN = new int[n];
 
	for (int i = 0; i < n; i++)
		cin >> nizN[i];
 
	int* nizQ = new int[q];
 
	for (int i = 0; i < q; i++)
		cin >> nizQ[i];
 
	sort(nizN, nizN + n);
 
	int maxN = nizN[n - 1];
 
	for (int i = 0; i < q; i++)
	{
		int toCheck = nizQ[i];
 
		int medianNizN = nizN[n/2];
 
		if (toCheck <= medianNizN)
		{
			cout << 0 << endl;
		}
		else if (toCheck > maxN)
		{
			cout << n << endl;
		}
		else
		{
			int dole = n/2;
			int gore = n;
 
			int pos = (dole + gore) / 2;
 
			while (dole < gore && toCheck != nizN[pos])
			{
				if (toCheck > nizN[pos])
					dole = pos;
				else
					gore = pos;
 
				pos = (dole + gore) / 2;
			}
 
			cout << pos * 2 - n << endl;
 
		}
 
 
	}
 
	return 0;
}