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

typedef long long ll;
#define all(x) x.begin(), x.end()
#define dbg(x) cout << (x) << "\n"
#define pf push_front
#define pb push_back
#define mp make_pair
#define f first
#define s second

int main()
{
    int n,q,i,m=0,j,k=0,p=0;
    cin>>n;
    cin>>q;
    int a[n],b[q],r[q];

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

    sort(a,a+n);
    sort(b,b+q);

    m = a[n/2];
    for(i=0;i<q;i++){
        for(j=0;j<n;j++){
            if(a[j]==b[i] && b[i]>m){
                r[i] = n-j-1;
                k = 1;
            }
            if(a[j]==b[i] && b[i]<m){
                r[i] = n-j+1;
                k = 1;
            }
            if(a[j]==b[i] && b[i]==m){
                r[i] = 0;
                k = 1;
            }
            if(b[i]>a[j] && b[i]<a[j+1]){
                p = j;
                k = 0;
                if(p + 1 == (n+1)/2){
                    k = 1;
                    r[i] = 0;
                }
            }
        }
        if(k==0)
            r[i] = n;
        if(k==0 && b[i]<a[0])
            r[i] = n + 1;
        if(k==0 && (b[i]>a[0] && b[i]<a[n-1]))
            r[i] = n - p;
        k = 0;
    }

    for(i=0;i<q;i++)
        dbg(r[i]);
    return 0;
}