using System;

namespace ConsoleApp1
{
    class Program
    {
        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[200000];
            for (int i = 0; i < n; i++)
            {
                a[i] = int.Parse(s[i]);
            }
            s = Console.ReadLine().Split();
            int[] b = new int[200000];
            for (int i = 0; i < q; i++)
            {
                b[i] = int.Parse(s[i]);
            }
            for (int i = 0; i < q; i++)
            {
                int m = 0, t = 0, v = 0, z = 0;
                for (int j = 0; j < n; j++)
                {
                    if (a[j] == b[i]) t++;
                    else if (a[j] > b[i]) v++;
                    else m++;
                }
                if (t == 0)
                {
                    z++;
                    t++;
                }
                if (m < v)
                {
                    m += t;
                    z++;
                    while (m < v)
                    {
                        m++;
                        z++;
                    }
                }
                else
                {
                    v += t;
                    while (v < m)
                    {
                        v++;
                        z++;
                    }
                }
                Console.WriteLine(z);
            }
        }
    }
}