#include <bits/stdc++.h>
using namespace std;

long long n,q,a[100000005],b[100000005],m;

int main(){
  cin >> n >> q;

  for(int i = 1; i <= n; i++){
    cin >> a[i];
  }
  sort(a+1,a+n+1);

  m = n/2+1;

  for(int i = 1; i <= q; i++){
    cin >> b[i];
    if(b[i] == m){
      cout << 0 << endl;
    }
    else if(b[i] > a[n]){
      cout << n << endl;
    }
    else if(b[i] < a[1]){
      cout << n+1 << endl;
    }
  }

  return 0;
}