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

namespace Medijana
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] s = Console.ReadLine().Split();
            int n = int.Parse(s[0]);
            int q = int.Parse(s[1]);
            int[] glasovi = new int[n];
            s = Console.ReadLine().Split();
            for(int i = 0; i < s.Length; i++)
            {
                glasovi[i] = int.Parse(s[i]);
            }
            int[] slucajevi = new int[q];
            s = Console.ReadLine().Split();
            for (int i = 0; i < s.Length; i++)
            {
                slucajevi[i] = int.Parse(s[i]);
            }
            Array.Sort(glasovi);
            foreach(int e in glasovi)
            {
                Console.Write(e + " ");
            }
            Console.WriteLine();
            for(int j = 0; j < q; j++)
            {
                if (slucajevi[j] == glasovi[n / 2])
                {
                    Console.WriteLine(0);
                }
                else if (slucajevi[j] > glasovi[glasovi.Length - 1] || slucajevi[j] < glasovi[0])
                {
                    Console.WriteLine(glasovi.Length);
                }
                else
                {
                    int id = Array.IndexOf(glasovi, slucajevi[j]);
                    int duzina = glasovi.Length;
                    if(id == -1)
                    {
                        for (int i = 0; i < glasovi.Length; i++)
                        {
                            if (glasovi[i] > slucajevi[j])
                            {
                                id = i+1;
                                duzina++;
                                break;
                            }
                        }
                    }
                    if (id >= duzina / 2)
                    {
                        Console.WriteLine(duzina - 1 - id);
                    }
                    else
                    {
                        Console.WriteLine(duzina - id);
                    }
                }
            }
        }
    }
}