#include <iostream>

using namespace std;

int main()
{
    int n, q;
    int brmanjih = 0;
    int brvecih = 0;
    int bristih = 0;
    cin >> n >> q;
    int a[999999];
    int b[999999];
    for (int i = 1; i <= n; i++) {
        cin >> a[i];
    }
    for (int i = 0; i < q; i++) {
        cin >> b[i];
    }
    int br = 0;
    for (int i = 0; i < q; i++) {
        for (int j = 1; j <= n; j++) {
            if (b[i] > a[j]) {
                brmanjih++;
            }
            else if (b[i] < a[j]) {
                brvecih++;
            }
            else {
                bristih++;
            }
        }
        if (brmanjih > brvecih) {
            br = abs(brvecih - brmanjih) - 1;
        }
        if (brvecih > brmanjih) {
            br = abs(brvecih - brmanjih);
        }
        if (bristih == 0) {
            br++;
        }
        cout << br << endl;
        br = 0;
        bristih = 0;
        brvecih = 0;
        brmanjih = 0;
    }
}