#include <iostream>
#include <algorithm>
using namespace std;

int trazeni(int a[], int n, int x)
{
	int manje = 0, vece = 0, jednako = 0;
	for(int i = 0; i < n; i++)
	{
		if(a[i] == x)
			jednako++;
		if(a[i] > x)
			vece++;
		if(a[i] < x)
			manje++;
	}
	
	int s = 0;
	if(manje > vece)
		s = manje-vece-1;
	else if(manje < vece)
	{
		s = vece-manje-1;
	}
	
	return s+1-jednako;
}

int main()
{
	int n, q;
	cin >> n >> q;
	
	int a[n*n], b[q*q];
	
	for(int i = 0; i < n; i++)
	{
		cin >> a[i];
	}
	
	for(int i = 0; i < q; i++)
	{
		cin >> b[i];
	}
	
	for(int i = 0; i < q; i++)
	{
		cout << trazeni(a, n, b[i]) << endl;
	}
	
	return 0;
}