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

namespace Takmicenje
{
    internal class Program
    {
        static void Main(string[] args)
        {
            int N, Q;
            var citac = Console.ReadLine().Split();
            N = int.Parse(citac[0]);
            Q = int.Parse(citac[1]);
            var glasovi = new int[N];
            var meridian = new int[Q];
            citac = Console.ReadLine().Split();
            for (int i = 0; i < N; i++)
            {
                glasovi[i] = int.Parse(citac[i]);
            }
            citac = Console.ReadLine().Split();
            for(int i = 0; i < Q; i++)
            {
                meridian[i] = int.Parse(citac[i]);
            }
            Array.Sort(glasovi);
            for(int i = 0;i < Q; i++)
            {
                int indx = Array.IndexOf(glasovi, meridian[i]) + 1;
                N = int.Parse(citac[0]);
                if (glasovi.Length % 2 == 0)
                {
                    if(indx == 0)
                    {
                        indx = N + 1;
                    }
                    int dodati = indx * 2 - 2;
                    int resenje = dodati - N;
                    Console.WriteLine(resenje );
                }
                else
                {
                    if (indx == 0)
                    {
                        indx = N + 1;
                        N++;
                    }
                    int dodati = indx * 2 - 1;
                    int resenje = dodati - N;
                    Console.WriteLine(resenje);
                }
            }
        }
    }
}