using System;

namespace ConsoleApp53
{
    class Program
    {
        static int pretrazi(int[] a, int n, int scenario)
        {
            int manji = 0, veci = 0, ostalo = 0;
            for (int i = 0; i<n; i++)
            {
                if (a[i] < scenario) manji++;
                if (a[i] > scenario) veci++;
            }
            ostalo = n - manji - veci;
            if (manji == n) return n;
            if (veci == n) return n + 1;
            if (manji + ostalo > n / 2 || veci + ostalo > n / 2) return 0;
            return Math.Abs(manji - veci);
        }
        static void Main(string[] args)
        {
           
            string[] unos = Console.ReadLine().Split();
            int n = int.Parse(unos[0]), q = int.Parse(unos[1]);
            int[] a = new int[n], b = new int[q];
            unos = Console.ReadLine().Split();
            for (int i = 0; i < n; i++)
            {
                a[i] = int.Parse(unos[i]);
            }
            unos = Console.ReadLine().Split();
            for (int i = 0; i < q; i++)
            {
                b[i] = int.Parse(unos[i]);
            }
            // sortiramo
            for (int i = 0; i < n - 1; i++)
                for (int j = i + 1; j < n; j++)
                {
                    if (a[i] > a[j])
                    {
                        int pomoc = a[i];
                        a[i] = a[j];
                        a[j] = pomoc;
                    }
                }
            
            // pretraga
            for (int i = 0; i < q; i++)
                Console.WriteLine(pretrazi(a, n, b[i]));
          
            

        }
    }
}