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

namespace markoso
{
    internal class Program
    {
        static int KolikoBrojevaSeDodaje(int[] niz, int x)
        {
            int n = niz.Length;

            int brojac = 0;

            int m = 0; // manji
            int v = 0; // veci
            int j = 0; // jednak

            for (int i = 0; i < n; i++)
            {
                if (niz[i] == x)
                    j++;
                else if (niz[i] > x)
                    v++;
                else if (niz[i] < x)
                    m++;
            }

            if (m > v)
                brojac = m - v - 1;
            else if (m < v)
                brojac = v - m - 1;

            return brojac + 1 - j;

        }
        static void Main(string[] args)
        {
            string[] s1 = Console.ReadLine().Split();
            int n = int.Parse(s1[0]);
            int q = int.Parse(s1[1]);

            string[] s2 = Console.ReadLine().Split();
            int[] a = new int[n];
            for (int i = 0; i < n; i++)
                a[i] = int.Parse(s2[i]);

            string[] s3 = Console.ReadLine().Split();
            int[] b = new int[q];
            for (int i = 0;i < q; i++)
                b[i] = int.Parse(s3[i]);
            
            Array.Sort(a);
            Array.Sort(b);
            

            for (int i = 0; i < q; i++)
            {
                Console.WriteLine(KolikoBrojevaSeDodaje(a, b[i]));
            }
        }
    }
}