#include <bits/stdc++.h>

using namespace std;
typedef long long ll;
#define cy cout << "YES"<< endl;
#define cn cout << "NO"<< endl;
#define pf push_front
#define pb push_back
#define all(x) x.begin(), x.end()
#define vi vector<int>
#define vll vector<ll>


void solve()
{
    int n,q;cin >> n >> q;
    vi v(n+1);
    for(int i = 1; i < n+1; i++)
        cin >> v[i];
    sort(all(v));
    vi v2(q);
    for(int i = 0; i < q; i++)
        cin >> v2[i];
    for(int j = 0; j < q; j++)
    {
        v.pb(v2[j]);
        int l = 0, h = 0, e = 0;
        for (int i = 0; i < n+1; i++) {
 
        if (v[i] == v2[j])
            e++;
        else if (v[i] > v2[j])
            h++;
        else if (v[i] < v2[j])
            l++;
    }
 
    int ans = 0;
    if (l > h)
        ans = l - h;
    else if (l < h)
        ans = h - l - 1;
         cout << max(ans-e-1,0) << endl;
    }
}

int main()
{
    ios::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(nullptr);
 
    solve();
}