#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
using namespace std;

int main()
{
    int n, q;
    cin >> n >> q;
    vector<int> a(n);
    for(int i=0; i<n; i++)
        cin >> a[i];
    sort(a.begin(), a.end());
    vector<int> b(q);
    for(int j=0; j<q; j++)
        cin >> b[j];
    int m = a[floor(n/2.0)];
    int resenje = 0;
    for(int k=0; k<q; k++)
    {
        if(b[k]>m){
            int x = 0, y = n-1;
            while(x<y){
                int z = x + (y - x) / 2;
                if(a[z] >= b[k])
                    y = z;
                else
                    x = z + 1;
            }
            if(a[y]>=b[k]){
                resenje = y - (n-y);
            }
            else{
                resenje = n;
            }
        }
        if(b[k]<m){
            int x = 0, y = n-1;
            while(x<y){
                int z = x + (y - x) / 2;
                if(a[z] > b[k])
                    y = z;
                else
                    x = z + 1;
            }
            resenje = y;
        }
        if(b[k] == m){
            resenje = 0;
        }
        cout << resenje << endl;
    }
    return 0;
}