#include <iostream>
#define MAX 200000
#include<algorithm>

using namespace std;

int main()
{
    int n,q, re, me, oof ;
    int a[MAX], b [MAX];
    cin>>n>>q;
    for(int i=0; i<n; i++)
        cin >> a[i];

    for(int i=0; i<q; i++)
        cin >> b[i];


    sort(a, a + n);

    for(int i=0; i<q; i++)
    {
        int r;
        r=0;
        re=0;
        me=0;
        oof=0;
        int i1=i;
        if ((n%2==0 && (a[n/2-1]+a[n/2])/2== b[i1]) || a[n/2] == b[i1])
        {
            cout<<r<<endl;
        }
        else
        {
        for (int i=0; i<n; i++ )
        {
            if (a[i]<b[i1])
            {
                re++;
            }
            else if (a[i]==b[i1])
            {
                re++;
                oof++;
            }
            else
            break;
        }
         me=n-re;

        if (me==re)
        {
           r=1;
           cout<<r<<endl;
        }
        else if (me>re)
        {
            r=(me-re)+1;
            cout<<r<<endl;
        }
        else
        {
            float kuku =(a[re-1-oof]+ b[i1])/2.0;
            //cout<<a[re-1-oof]<<endl;
            //cout<<b[i1]<<endl;
            if((kuku+0.5)==b[i1])
            {
                r=re-me-oof;
                cout<<r<<endl;
            }
            else{
                r=re-me+1-oof;
                cout<<r<<endl;
            }
        }
        }
    }

    return 0;
}