#include <stdio.h>
#include <stdlib.h>
int sadrzi(int*niz, int len, int n){
  for(int i = 0; i < len; i++)
    if(niz[i] == n)
      return 1;
  return 0;
}
int main() {
  int n, q;
  scanf("%d%d", &n, &q);
  int *a = (int *)malloc(n * sizeof(int));
  int *b = (int *)malloc(q * sizeof(int));
  for (int i = 0; i < n; i++)
    scanf("%d", a + i);
  for (int i = 0; i < q; i++)
    scanf("%d", b + i);
  for (int i = 0; i < n; i++)
    for (int j = i; j < n; j++)
      if (a[i] > a[j]) {
        int tmp = a[i];
        a[i] = a[j];
        a[j] = tmp;
      }
  int md = a[n / 2];
  for (int i = 0; i < q; i++) {
    int m = 0, j = 0, v = 0;
    for (int k = 0; k < n; k++) {
      if (b[i] > a[k])
        m++;
      else if (b[i] < a[k])
        v++;
      else
        j++;
    }
    int min = abs(v - m);
    if (b[i] < md && !sadrzi(a, n, b[i]))
      min++;
    if (b[i] > md && sadrzi(a, n, b[i]))
      min--;
    printf("%d\n", min);
  }
}