#include <iostream>
#include <algorithm>

using namespace std;

int main()
{
    int a, b;
    cin >> a >> b;
    int n[a], q[b];
    
    for (int i = 0; i < a; i++) cin >> n[i];
    for (int i = 0; i < b; i++) cin >> q[i];
    
    sort(n, n + a);
    
    for (int i = 0; i < b; i++) {
        if (q[i] > n[a - 1]) cout << a << endl;
        else {
            int j = 0;
            while (n[j] != q[i] && j < a) j++;
            int result = abs(a - 2 * j);
            if (j % 2 == 0) result--;
            cout << result << endl;
        }
    }

    return 0;
}