using System;

namespace petlja2
{
    class Program
    {
        static int veciod(int[] A,int x,int N)
        {
            int l= 0;
            int d = N - 1;

            int s = 0;
            while (l <= d)
            {
                int sre = (l + d) / 2;

                
                if (A[sre] <= x)
                {
                    l = sre + 1;

                }
                else
                {
                    s = sre;
                    d = sre - 1;
                }
            }
            return N-s;
        }
        static int manjiod(int[] A, int x, int N)
        {
            int l = 0;
            int d = N - 1;
            int s = 0;
            while (l <= d)
            {
                int sre = (l + d) / 2;


                if (A[sre] >= x)
                {
                    d = sre - 1;
                    

                }
                else
                {
                    s = sre;
                    l = sre + 1;
                }
            }
            return s;
        }
        static void Main(string[] args)
        {
            string[] s = Console.ReadLine().Split(" ");
            int N = int.Parse(s[0]);
            int Q = int.Parse(s[1]);
            int[] A = new int[N];
            int[] B = new int[Q];
            string[] a = Console.ReadLine().Split(" ");
            for (int i=0;i<N;i++)
            {
                A[i] = int.Parse(a[i]);
            }
            string[] b = Console.ReadLine().Split(" ");
            for (int i = 0; i < Q; i++)
            {
                B[i] = int.Parse(b[i]);
            }
            Array.Sort(A);
            for(int i=0;i<Q;i++)
            {
                if (B[i] > A[N / 2 ])
                    Console.WriteLine(veciod(A, B[i], N));
                else
                    if (B[i] != A[N / 2 ])
                    Console.WriteLine(manjiod(A, B[i], N));
                else
                    Console.WriteLine(0);
            }
            
        }
    }
}