#include<bits/stdc++.h>

#define pb push_back
#define bend(a) a.begin(),a.end()

using namespace std;

vector <int> a;

int ueb(int m, int b, int n)
{
    int d=-1;
    int l=0, s=m;
    
    while(l<=s)
    {
        int mid=(l+s)/2;
        
        if(a[mid]<=b)
        {
            d=mid;
            l=mid+1;
        }
        else if(a[mid]>b)
        {
            s=mid-1;
        }
    }
    
    return d;
}

int leb(int m, int b, int n)
{
    int d=n;
    int l=m, s=n-1;
    
    while(l<=s)
    {
        int mid=(l+s)/2;
        
        if(a[mid]>=b)
        {
            d=mid;
            s=mid-1;
        }
        else if(a[mid]<b)
        {
            l=mid+1;
        }
    }
    
    return d;
}

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    
    int n,q;
    
    cin >> n;
    cin >> q;
    
    for(int i=0; i<n; i++)
    {
        int temp;
        
        cin >> temp;
        
        a.pb(temp);
    }
    
    sort(bend(a));

    for(int i=0; i<q; i++)
    {
        int b;
        
        cin >> b;
        
        if(b<a[n/2])
        {
            int k = ueb(n/2,b,n);
            
            if(k==-1)
            {
                cout << n+1 << "\n";
            }
            else
            {
                cout << n-2*k-1 << "\n";
            }
        }
        else if(b==a[n/2])
        {
            cout << 0 << "\n";
        }
        else
        {
            int k = leb(n/2,b,n);
            
            cout << 2*k-n << "\n";
        }
    }
    
    return 0;
}