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

int main()
{
    ios::sync_with_stdio(0);
    cin.tie(0);
    long long q,n;
    vector<long long> b(200001,0);
    cin>>n>>q;
    for(int i=0;i<n;i++)
    {
        long long p;
        cin>>p;
        b[p]++;
    }
    long long granica=n/2+1;
    for(long long i=1;i<200001;i++)
        b[i+1]+=b[i];
    while(q--)
    {
        int broj;
        cin>>broj;
        long long pre=0,posle=0;
        pre=b[broj-1];
        posle=n-pre-(b[broj]-b[broj-1]);
        if((granica>pre)&&(granica<=n-posle))
            cout<<0<<"\n";
        else
        {
                cout<<abs(pre*2-n)<<"\n";
        }

    }
    return 0;
}