#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;

int main(){
    int n, q;
    vector<int> a, b;

    cin >> n >> q;
    
    int x;
    for(int i = 0; i < n; i++)
    {
        cin >> x;
        a.push_back (x);
    }
    
    for (int i = 0; i < q; i++)
    {
        cin >> x;
        b.push_back (x);
    }

    sort(a.begin(), a.end());

    int zamislio = 0;
    int formula = 0;
    int pamti = 0;
    int m = 0;
    int N = n;
    
    for(int j = 0;j < q;j++){

        int izlaz = 0;
        int pamti = 0;
        n = N;
        int formula = n/2;
        int zamislio = b[j];

    if(zamislio > a[n-1]){
        m = 2;
    }

    for(int i = 0; i <n;i++){
        if(a[i] == zamislio){
            pamti = i;
        }
    }

    if(pamti == 0){
        for(int i = 0;i < n-1;i++){
            if(zamislio > a[i] && zamislio < a[i+1]){
                pamti = i+1;
                n += 1;
                if(pamti == formula + 1){
                    m = 0;
                    break;
                }else{
                    izlaz += 1;
                    m = 1;
                    break;
                }
            }
        }

    }   
        formula = n/2;
        if(pamti == formula){
            cout << izlaz << endl;
        }else{


            while(pamti != formula){
                n += 1;

                if(pamti < formula){
                    pamti += 1;
                }
                izlaz += 1;

                formula = n/2;
            }  
            if(m == 2){
                cout << N << endl;
            }else{
                cout << izlaz << endl;
            }
        }       

    }
    return 0;
}