#include <bits/stdc++.h>
#define en '\n'

using namespace std;

vector<int> a;

int bs(int x)
{
    int l = 0, r = a.size() - 1,id=-1;
    while(l<=r)
    {
        int mid = (l+r)/2;
        if(a[mid]==x) return mid;
        else if(a[mid]>x) r=mid-1;
        else l = mid + 1,id=mid;
    }
    return id;
}

void solve()
{
    int m; cin >> m;
    int id = bs(m);
    if(id==-1)
    {
        int rez=a.size()+1;
        cout<<rez<<en;
        return;
    }
    int x=id+1,y;
    if(a[id]==m)
    {
        x=id;
        y=a.size()-x-1;
    }
    else y = a.size()-x;
    int ans = 0;
    if(a[id]!=m) ans += 1;
    if(x<=y)
    {
        ans += y-x;
    }
    else{
        int z = x - y - 1;
        if((x+y+z+1)%2==0) ans += z;
        else ans += z+1;
    }

    cout << ans << en;
}

int main()
{
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);

    int n,q;cin>>n>>q;
    a.resize(n);
    for(int&x:a)cin>>x;
    sort(a.begin(),a.end());
    while(q--)
    {
        solve();
    }
    /// medijana je a[n/2]

}