#include <bits/stdc++.h>


int main()
{
    int n,q;
    std::cin>>n>>q;
    n++;
    int a[n];
    int aa[n];

    int b[q];

    for (size_t i = 0; i < n-1; i++)
    {
        int tmp1;
        std::cin>>tmp1;
        a[i]=tmp1;

    }
    a[n-1]=-1;
    
    for (size_t i = 0; i < q; i++)
    {
        std::copy (a, a+n+1, aa);

        std::cin>>aa[n-1];

        int tmp=aa[n-1];

        std::sort(aa,aa+n);
        int index = std::find(aa, aa + n, tmp) - aa;

        if(index==(int)(n-1)/2) b[i]=0;
        else b[i]=abs(index-(n-index-1));
    }

    for (size_t i = 0; i < q; i++)
    {
        std::cout<<b[i]<<"\n";
    }
    
    return 0;
}