using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApplication1
{
    class Program
    {
        static void Citaj(int[]a , int n)
        {
            string[] st = Console.ReadLine().Split();
            for (int i = 0; i<n; i++){
                
                a[i] = int.Parse(st[i]);
            }
        } 
        static void Sort(int[]a , int n)
        {
            int p;
            for(int i = 0; i < n; i++)
            {
                for(int j = i + 1; j < n; j++)
                {
                    if (a[i] > a[j])
                    {
                        p = a[i];
                        a[i] = a[j];
                        a[j] = p;
                    }
                }
            }
        }
    static void Main(string[] args)
        {
            int br = 0 , p = 0 , k = 0 , t = 0 , broj = 0;
            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];
            Citaj(a, n);
            Sort(a, n);
            Citaj(b, q);
            int m = n;
            int[] pom = new int[q];
            for(int i = 0; i<q; i++)
            {
                for(int j = 0; j<n; j++)
                {
                    if (a[j] == b[i])
                    {
                        br = 1;
                        p = j;
                        break;
                    }

                }
                if (br == 1)
                {
                    while (m / 2 != p)
                    {
                        k++;
                        m++;
                    }
                    pom[t] = k;
                    t++;
                    m = n;
                    k = 0;
                }
                else
                {
                    if (n % 2 == 0)
                    {
                        k = n + 1;
                        pom[t] = k;
                        t++;
                    }
                    else
                    {
                        k = n;
                        pom[t] = k;
                        t++;
                    }
                }
                k = 0;
                br = 0;

            }
            for(t = 0; t < q; t++)
            {
                Console.WriteLine(pom[t]);
            }
        }
    }
}