using System;

class Program {
  static int broj_manjih(int[] a, int x) {
    int i = 0;
    int n = 0;
    while (i < a.Length && a[i] < x) {
      n++;
      i++;
    }
    return n;
  }
  public static void Main (string[] args) {
    string[] s = Console.ReadLine().Split();
    int n = int.Parse(s[0]);
    int q = int.Parse(s[1]);
    
    s = Console.ReadLine().Split();
    int[] a = new int[n];
    for (int i = 0; i < n; i++) {
      a[i] = int.Parse(s[i]);
    }
    
    s = Console.ReadLine().Split();
    int[] b = new int[q];
    for (int i = 0; i < q; i++) {
      b[i] = int.Parse(s[i]);
    }
    
    Array.Sort(a);

    for (int i = 0; i < q; i++) {
      int br_manjih = broj_manjih(a,b[i]);
      int br_vecih = n - br_manjih;
      if (Array.IndexOf(a,b[i]) != -1) { br_vecih--; }
      if (br_manjih == br_vecih) {Console.WriteLine(0);}
      else {
        int x = (int)Math.Abs(br_vecih - br_manjih);
        if (br_manjih < br_vecih && Array.IndexOf(a,b[i]) == -1) {x++;}
        else if (br_manjih > br_vecih && Array.IndexOf(a,b[i]) != -1) {x --;}
        
        Console.WriteLine(x);
      }
    }
  }
}