#include <bits/stdc++.h>

using namespace std;
int N, Q;

pair<int, int> findIndex(int n, int *A){
	int L = 0;
	int R = N - 1;
	int i = R;
	
	if(n > A[R]) return pair<int, int>(N, 0);
	else if(n == A[R]) return pair<int, int>(N - 1, 0);
	else if(n == A[L]) return pair<int, int>(0, N - 1);
	else if(n < A[L]) return pair<int, int>(0, N);
	
	while(true){
		if(L + 1 == R) return pair<int, int>(L + 1, N - R);
	
		int _i = L + (R - L) / 2;
		int midVal = A[_i];
		if(midVal == n){
			return pair<int, int> (_i, N - _i - 1);
		}else if(midVal < n){
			L = _i;
		}else{
			R = _i;
		}
	}
	
	
}

int main() {
	ios::sync_with_stdio(true); cin.tie(0);
	cin>>N>>Q;
	int A[N];
	
	for(int i = 0; i < N; i++){
		cin>>A[i];
	}
	sort(A, A+N);
	
	for(int i = 0; i < Q; i++){
		int B;
		cin>>B;
		pair<int, int> find = findIndex(B, A);

		if(find.first == find.second || find.first - 1 == find.second){
			cout<<"0"<<endl;
			continue;
		}

		bool exists = (find.first + find.second) < N;

		int add = 0;
		if((find.first - find.second) % 2 == 0 && exists) add = 1;
		
		cout<<abs(find.second - find.first) - add<<endl;
	}
	
	return 0;
}