#include <iostream>
#include <algorithm>
#include  <string>
using namespace std;
int binarySearch(int arr[], int p, int r, int num,int 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 p;
}


int main()
{
    int N,Q;
    cin >> N >> Q;
    int Array[N];
    int 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);
    int 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 << to_string(position) << endl;
    }
}