#include <iostream>
#include <algorithm>
using namespace std;
int pretraga(int a[], int n, int x){
    int l = 0, d = n-1;
    int s = l + (d-l)/2;
    int ind = -1;
    while(l<=d){
        s = l + (d-l)/2;
        if(a[s]==x){
            d = s-1;
            ind = s;
        }
        else if(a[s]>x){
            d = s-1;
        }
        else{
            l = s+1;
        }
    }
    if(ind!=-1){
        return ind;
    }
    if(s==n-1){
        return s+1;
    }
}
int main()
{
    int n,q;
    cin>>n>>q;
    int a[n];
    cin>>a[0];
    bool sorted = true;
    for(int i = 1; i<n; i++){
        cin>>a[i];
        if(a[i]<a[i-1]){
            sorted = false;
        }
    }
    int querry[q];
    for(int i = 0; i<q; i++){
        cin>>querry[i];
    }
    if(!sorted){
        sort(a,a+n);
    }
    for(int i = 0; i<q; i++){
        int index = pretraga(a,n,querry[i])+1;
        if(index%2==1){cout<<abs(2*index-1-n)<<endl;}
        else{cout<<abs(2*(index-1)-n)<<endl;}
    }
    return 0;
}