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

int howmuch(int n , int a[20000], int b){
    int less=0, same=0, more=0;
    for(int i=0; i<n; i++){
        if(a[i]<b)less++;
        if(a[i]==b)same++;
        if(a[i]>b)more++;
    }
	int difference=abs(more-less);
    if((difference+(same==0)+n)%2==1)	difference--;
    if(difference<0)	difference=0;
	return difference+(same==0);
}

int main(){
    int n, q;
    scanf("%d%d", &n, &q);
    int a[n], b[q];
    for(int i=0; i<n; i++){
        scanf("%d", &a[i]);
    }
    for(int i=0; i<q; i++){
        scanf("%d", &b[i]);
        b[i]=howmuch(n, a, b[i]);
    }
    for(int i=0; i<q; i++){
        printf("%d\n", b[i]);
    }
}