#include <bits/stdc++.h>

using namespace std;

int main()
{
    long long int n,q; cin >> n >> q;
    int a[1000000];
    int b[1000000];
    long long int manje = 0; long long int vece = 0;
    long long int glas = 0;
    for(long long int i = 0; i < n;i++){
        cin >> a[i];
    }
    for(long long int j = 0; j < q; j++){
        cin >> b[j];
    }
    
    for(long long int m = 0; m <q;m++){
        for(long long int i = 0; i < n ; i++){
            
            if(a[i] < b[m]) manje++;
            else vece ++;
            
            
            
            glas = abs(manje-vece);
            
        }
    if(a[n/2+1] == b[m] && n%2 != 0)
    cout << glas-1 << endl;   
    else cout << glas << endl;
    glas = 0; vece = 0; manje = 0;        
      
    }
    
    
    return 0;
}