#include <stdio.h>
#include <stdlib.h>
#include <algorithm>
#define tip int

tip absolute(tip x)
{
	if(x > 0)
		return x;
	return -x;
}
int cmpfunc(const void* a, const void* b)
{
	return *(tip*)a - *(tip*)b;
}
int main()
{
	tip q, n, b, med;
	tip* br, brpos;
	tip a[200000];

	scanf("%d%d", &n, &q);
	for(tip i = 0; i < n; i++)
		scanf("%d", &a[i]);
	std::sort(a, a+n);
	med = n / 2;
	for(tip i = 0; i < q; i++)
	{
		scanf("%d", &b);
		br = (tip*) bsearch(&b, a, n, sizeof(tip), cmpfunc);
		if(br == NULL)
			printf("%lu\n", n);
		else
		{
			brpos = (br - a) % sizeof(tip);
			printf( "%lu\n", absolute(brpos - med) );
		}
	}

	return 0;
}