#include <bits/stdc++.h>

using namespace std;
int indeks(vector<int> v, int x)
{
    int l = v.size();
    for (int i = 0; i < l; i++)
    {
        if (v.at(i) == x)
        {
            return i;
            break;
        }
    }
}
int main()
{
    //#ivucicnamestaglasove
    int n, q;
    vector<int> a, b;
    cin >> n >> q;
    a.resize(n);
    b.resize(q);
    for (int i = 0; i < n; i++)
    {
        cin >> a[i];
    }
    for (int i = 0; i < q; i++)
    {
        cin >> b[i];
    }
    sort(a.begin(), a.end());
    int indeksmedijane = n / 2 + 1;
    int m = a[indeksmedijane];
    for (int i = 0; i < q; i++)
    {
        if (b[i] > a.at(n - 1))
        {
            cout << n << endl;
        }
        else
        {
            cout << abs(indeks(a, b[i]) + 1 - indeksmedijane) << endl;
        }
    }
    return 0;
}