using System;
using System.Linq;

namespace Namestanje_glasanja
{
    internal class Program
    {
        static void Main(string[] args)
        {
            string input = Console.ReadLine();
            int n = Convert.ToInt32(input.Split(' ')[0]);
            int q = Convert.ToInt32(input.Split(' ')[1]);
            int[] glasovi = new int[n];
            int[] zelje = new int[q];
            input = Console.ReadLine();
            string[] glas = input.Split(" ");
            for (int i = 0; i < n; i++)
            {
                glasovi[i] = Convert.ToInt32(glas[i]);
            }
            Array.Sort(glasovi);
            input = Console.ReadLine();
            glas = input.Split(" ");
            for (int i = 0; i < q; i++)
            {
                zelje[i] = Convert.ToInt32(glas[i]);
            }
            foreach (int zelja in zelje)
            {
                if (zelja > glasovi[n - 1])
                {
                    Console.WriteLine(n);
                }
                else if (zelja < glasovi[0])
                {
                    Console.WriteLine(n + 1);
                }
                else
                {
                    for (int i = 0; i < n; i++)
                    {
                        if (glasovi[i] == zelja)
                        {
                            Console.WriteLine((n - i - 1 > i) || (n - i - 1 == i && n % 2 == 1) ? n - 2 * i - 1 : 2 * i - n);
                            goto Next;
                        }
                    }
                    int n1 = 0, n2 = n, m;
                    while (n2 - n1 != 1)
                    {
                        m = (int)Math.Floor((double)((n1 + n2) / 2));
                        if (zelja < glasovi[m]) n2 = m; else n1 = m;
                    }
                    Console.WriteLine((n - n2 > n2) || (n - n2 == n2 && n % 2 == 0) ? n - 2 * n2 + 1 : 2 * n2 - n);
                }
            Next:;
            }
        }
    }
}