#include <iostream>
#include <algorithm>
using namespace std;
int binarySearch(long arr[], long p, long r, long num,long N) {
   if (p <= r) {
      int mid = (p + r)/2;
      if (arr[mid] == num)
         return mid ;
      if (arr[mid] > num)
         return binarySearch(arr, p, mid-1, num,N);
      if (arr[mid] < num)
         return binarySearch(arr, mid+1, r, num,N);
   }
   return N;
}


int main()
{
    long N,Q;
    cin >> N >> Q;
    long Array[N];
    long Nums[Q];
    for(int i=0;i<N;i++){cin >> Array[i];}
    for(int i=0;i<Q;i++){cin >> Nums[i];}
    sort(Array, Array+N);
    long position;
    for(int i=0;i<Q;i++){
    position = binarySearch(Array,0,N,Nums[i],N);
    position = abs(position - N/2);
    if(position!=0){
    if(N%2==0){
        position *= 2;
    }
    if(N%2==1){
        position = (position-1)*2 + 1;
    }}
    cout << position << endl;
    }
}