using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            string str = Console.ReadLine(); // prvi

            int n = int.Parse(str.Split()[0]);
            int q = int.Parse(str.Split()[1]);

           
            int[] a = new int[n];
            // int[] a1 = new int[n];
            int[] b = new int[q];
            
            str = Console.ReadLine(); // drugi
            
            int i = 0;
            while (i < n)
            {
                a[i] = int.Parse(str.Split()[i]);
                i++;
            }
            str = Console.ReadLine(); // treci

            int j=0;
            while (j < q)
            {
                b[j] = int.Parse(str.Split()[j]);
                j++;
            }

            Array.Sort(a);
            int m = a[n / 2];
            // Console.WriteLine(m);

            j = 0;
            int rez = 0;
            while (j < q)
            {
                if (b[j]==m)
                    Console.WriteLine(rez);
                else if (b[j] > a[n - 1])
                    Console.WriteLine(n);
                else if (b[j] < a[0])
                    Console.WriteLine(n+1);
                else if (b[j] > m)
                {
                    i = (n / 2) + 1;
                    while (i < n)
                    {
                        if (b[j] <= a[i])
                        {
                            rez = rez + 1;
                            break;
                        }
                        else
                        {
                            rez = rez + 1;
                            i++;
                        }
                    }
                    Console.WriteLine(rez);
                }
                else // b[j]<m
                {
                    i = (n / 2) - 1;
                    while (i >= 0)
                    {
                        if (b[j] >= a[i])
                        {
                            rez = rez + 1;
                            break;
                        }
                        else
                        {
                            rez = rez + 1;
                            i--;
                        }
                    }
                    Console.WriteLine(rez+1);
                }

                j++;
            }

            Console.ReadLine();
        }
    }
}