using System;

namespace ConsoleApp1
{
    class Program
    {
        public static int[] Sort(int n, int[] a)
        {
            int t = a[0];
            for (int i = 0; i < n; i++)
            {
                for (int j = i + 1; j < n; j++)
                {
                    if (a[i] > a[j])
                    {
                        t = a[i];

                        a[i] = a[j];

                        a[j] = t;
                    }
                }
            }
            return a;
        }
        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]);
            }
            a = Sort(n, a);
            for (int i = 0; i < q; i++)
            {
                int m = 0, t = 0, v = 0, z = 0, j = 0;
                while (a[j] < b[i])
                {
                    if (j != n) j++;
                    else break;
                }
                m = j;
                while (a[j] == b[i])
                {
                    if (j != n) j++;
                    else break;
                
                }
                v = n - j;
                t = n - m - v;
                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);
            }
        }
    }
}