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

namespace ConsoleApp4
{
    internal class Program
    {
        private static void Quick_Sort(int[] arr, int left, int right)
        {
            if (left < right)
            {
                int pivot = Partition(arr, left, right);

                if (pivot > 1)
                {
                    Quick_Sort(arr, left, pivot - 1);
                }
                if (pivot + 1 < right)
                {
                    Quick_Sort(arr, pivot + 1, right);
                }
            }

        }
        private static int Partition(int[] arr, int left, int right)
        {
            int pivot = arr[left];
            while (true)
            {

                while (arr[left] < pivot)
                {
                    left++;
                }

                while (arr[right] > pivot)
                {
                    right--;
                }

                if (left < right)
                {
                    if (arr[left] == arr[right]) return right;

                    int temp = arr[left];
                    arr[left] = arr[right];
                    arr[right] = temp;


                }
                else
                {
                    return right;
                }
            }
        }
        static void Main(string[] args)
        {
            string[] red = Console.ReadLine().Split(' ');
            int n = int.Parse(red[0]);
            int q = int.Parse(red[1]);
            int[] a = new int[n];
            int[] b = new int[q];
            int[] d = new int[n];
            red = Console.ReadLine().Split(' ');
            for(int i = 0; i < n; i++)
            {
                a[i] = int.Parse(red[i]);
            }
            red = Console.ReadLine().Split(' ');
            for(int i = 0; i < q; i++)
            {
                b[i] = int.Parse(red[i]);
            }
            Quick_Sort(a, 0, a.Length - 1);
            int j = 0;
            int m = a[n / 2];
            while (j<q)
            { 
                int lokacija=0;
                for(int i = 0; i < n; i++)
                {
                    if (b[j] <= a[i])
                    {
                        lokacija = i;
                        break;
                    }
                }
                int veci = n - lokacija;
                int manji = lokacija;
                if (b[j] == m)
                {
                    Console.WriteLine(0);
                }
                else if (b[j] > a[n - 1] || b[j] < a[0])
                {
                    Console.WriteLine(n);
                }
                else if (b[j] > m)
                {
                    Console.WriteLine(manji - veci);
                }
                else
                {
                    Console.WriteLine(veci - manji-1);
                }
                j++;
            }
            Console.ReadLine();
        }
    }
}