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

namespace ConsoleApplication317
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] str1 = Console.ReadLine().Split();
            int n = int.Parse(str1[0]);
            int q = int.Parse(str1[1]);
            string[] str2 = Console.ReadLine().Split();
            string[] str3 = Console.ReadLine().Split();
            long[] a = new long[n];
            for (int i = 0; i < n; i++)
            {
                a[i] = long.Parse(str2[i]);
            }
            Array.Sort(a);
            for (int i = 0; i < q; i++)
            {
                long x = long.Parse(str3[i]);
                int sred = n / 2;
                if (x == a[sred]) Console.WriteLine("0");
                else
                {
                    if(x>a[sred])
                    {
                        int id = Array.FindIndex(a, k => k == x);
                        int l = id;
                        int d = n - 1 - id; 
                        Console.WriteLine(l - d - 1);
                    }
                    else
                    {
                        int id = Array.FindLastIndex(a, k => k == x);
                        int l = id;
                        int d = n - 1 - id;
                        Console.WriteLine(d - l);
                    }
                }
            }
            Console.ReadKey();
        }
    }
}