#include <bits/stdc++.h>

using namespace std;
int minNumbersToBeAdded(vector<int> arr, int n, int x){
   sort(arr.begin(), arr.end());
   int cnt = 0;
   int jao = (n - 1) / 2;
   if (n % 2 == 0) jao++;
   while (arr[jao] != x) {
      arr[n] = x;
      ++n;
      sort(arr.begin(), arr.end());
      ++cnt;
      jao = (n - 1) / 2;
      if (n % 2 == 0) jao++;
   }
   return cnt;
}
int main(){
    vector<int> arr;
    int x, y, n;
    cin >> x >> y;
    arr.resize(x);
    for (int i = 0; i < x; i++)
        cin >> arr[i];
    for (int i = 0; i < y; i++){
        cin >> n;
        cout << minNumbersToBeAdded(arr, x, n) << endl;
    }
   return 0;
}