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

int main(){
    int n,q;
    int br;
    int b;
    int j;
    int dn;
    int s,l,d;
    l=0;
    cin >> n >> q;
    d=n-1;
    int a[n];
    for (int i=0;i<n;i++){cin>>a[i];}
    sort(a, a + n);
    for (int i=0;i<q;i++){
        cin>>b;
        if (b>a[n-1]) {dn=n-1;}
        else{
            while (l<=d){
                s=l+(d-l)/2;
                if (a[s]<b) {l=s+1;}
                else{
                    j=s;
                    d=s-1;
                }
            }
            dn=2*j-n;
        }
        cout << dn << "\n";
    }
    return 0;

}