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

namespace ConsoleApp13
{
    internal class Program
    {
        static void Main(string[] args)
        {
            string[] pred = Console.ReadLine().Split(' ');
            string[] dred = Console.ReadLine().Split(' ');
            string[] tred = Console.ReadLine().Split(' ');
            int n = int.Parse(pred[0]);
            int q = int.Parse(pred[1]);
            int[] a = Array.ConvertAll(dred, int.Parse);
            Array.Sort(a);
            
            
            int maksi = n - 1;
            string res = "";
            
           
            for(int i = 0;i<tred.Length;i++)
            {
                int x = int.Parse(tred[i]);
                int indeks = Array.BinarySearch(a, x);
                int rez = 0;
              
                int n2 = indeks * 2 - indeks % 2;
                rez = Math.Abs(maksi - n2);
                res+=rez.ToString() + Environment.NewLine;
                
                


            }
            Console.WriteLine(res);
            Console.Read();
        }
    }
}