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

int bs(int a[],int n,int x,int &p){
    int l=0,d=n-1;
    int s;
    while(d-l>=1){
        s=(l+d)/2;
        if(a[s]>x)d=s-1;
        else{if(a[s]<x)l=s+1;
             else if(a[s]==x)return s;}
    }
    p++;
    if(a[l]>x)return l;
    if(a[d]<x)return d+1;
    return s;
}
void minb(int a[],int x,int n){
    sort(a,a+n);
    if(x>a[n-1])cout<<n<<endl;
    else{ 
        if(x<a[0])cout<<n+1<<endl;
        else{int p=0,bd,bl;
            int i=bs(a,n,x,p);
            bd=n-i-1+p;
            bl=i;
            cout<<abs(bd-bl)+p-(i>n/2)<<endl;
    }}
    
}
int main()
{
    int n,q,p=0;
    cin>>n>>q;
    int a[n],b[q];
    for(int i=0;i<n;i++)
        cin>>a[i];
    for(int i=0;i<q;i++)            
        cin>>b[i];
    for(int i=0;i<q;i++)
        minb(a,b[i],n);
    return 0;
}