#include<bits/stdc++.h>
using namespace std;
int binarnaPretraga(int arr[], int l, int r, int x)
{
    if (l<=r) {
        int s = l + (r - l) / 2;
        if (arr[s] == x)
            return s;
        if (arr[s] > x)
            return binarnaPretraga(arr, l, s - 1, x);
        return binarnaPretraga(arr, s + 1, r, x);
    }
    return l-1;
}
int main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0); cout.tie(0);
    int N, Q;
    cin >> N >> Q;
    int A[200000];
    int B[200000];
    for (size_t i = 0; i < N; i++)
    {
        cin >> A[i];
    }
    sort(A, A + N);
    for (size_t i = 0; i < Q; i++)
    {
        cin >> B[i];
        int c = binarnaPretraga(A, 0, N, B[i]);
        int m = (abs(c - N / 2) - 1) * 2 + 1;
        if (m > 0)cout << m<<"\n";
        else cout << 0<<"\n";
    }
}