using System;

namespace Namestanje_glasova
{
    class Program
    {
        static int Br(int[] A, int br) 
        {
            int brojac1 = 0;
            int brojac2 = 0;
            for (int i = 0; i < A.Length; i++)
            {
                if (br > A[i]) 
                    brojac1++;
                else if(br < A[i])
                        brojac2++;
            }

            return Math.Abs(brojac1 - brojac2);
        }
        static void Main(string[] args)
        {
            string[] c = Console.ReadLine().Split(" ");
            int N = int.Parse(c[0]);
            int Q = int.Parse(c[1]);

            string[] a = Console.ReadLine().Split(" ");
            int[] A = new int[N];
            for (int i = 0; i < N; i++)
            {
                A[i] = int.Parse(a[i]);
            }

            string[] b = Console.ReadLine().Split(" ");
            int[] B = new int[N];
            for (int i = 0; i < Q; i++)
            {
                B[i] = int.Parse(b[i]);
            }

            Array.Sort(A);
            for (int i = 0; i < Q; i++)
            {
                Console.WriteLine(Br(A, B[i]));
            }
        }
    }
}