#include<stdio.h>
#include<math.h>
int main(){
	int n, q;
	scanf("%d%d", &n, &q);
	int niz[n];
	int slucajevi[q];
	
	for (int i = 0; i < n; i++) 
		scanf("%d", &niz[i]);
	
	for (int i = 0; i < q; i++)
		scanf("%d", &slucajevi[i]);

	for (int i = 1; i < n; i++)
		for (int j = 0; j < n - i; j++)
			if (niz[j] > niz[j + 1]) {
				int pom = niz[j];
				niz[j] = niz[j + 1];
				niz[j + 1] = pom; 
			}
	
	for (int i = 0; i < q; i++) {
		int index = 0, postoji = 1;
		for (int j = 0; j < n; j++) {
			if (niz[j] == slucajevi[i])
				postoji--;
			if (niz[j] >= slucajevi[i])
				break;
			index++;
		}
			 
		if (index >= n / 2) {
			int n2 = n;
			while(n2 / 2 < index)
				n2++;
			printf("%d\n", n2 - n);
		} else {
			int n2 = n + postoji;
			while(n2 / 2 > index) {
				n2++;
				index++;
			}
			printf("%d\n", n2 - n);
		}
	}
}