#include <bits/stdc++.h>
#define ll long long
using namespace std;

int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	ll n,q;
	cin>>n>>q;
	unordered_map<ll,ll> m;
	vector<ll> a(n);
	for(ll i=0;i<n;i++)
	{
	    cin>>a[i];
	    m[a[i]]++;
	}
	sort(a.begin(),a.end());
	while(q--)
	{
	    ll d;
	    cin>>d;
	    ll l=0,r=(1100000000000000000);
	    while(r-l > 1)
	    {
	        ll m = (l+r)/2;
	        ll cnt = upper_bound(a.begin(),a.end(),m)-a.begin();
	        if(m - cnt >= d)
	        {
	            r=m;
	        }
	        else
	        {
	            l=m;
	        }
	    }
	    cout<<r<<"\n";
	}
}
#include <bits/stdc++.h>
using namespace std;

using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
using vl = vector<ll>;
using vvl = vector<vl>;
using vb = vector<bool>;
using vvb = vector<vb>;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
#define rep(i, s, n) for(int i = (int)(s); i < (int)(n); ++i)

ll INF = 1ll << 60;

int main(){
    ll n, q;
    cin >> n >> q;
    vl a(n);
    rep(i, 0, n){
        cin >> a[i];
    }
    vector<pll> k(q);
    rep(i, 0, q){
        ll t;
        cin >> t;
        k[i] = {t, i};
    }
    sort(k.begin(), k.end());

    vl ans(q);
    int id = 0;
    rep(i, 0, q){
        ll t = k[i].first;
        if(id == 0){
            if(a[0]-1 >= t){
                ans[k[i].second] = t;
                continue;
            }
        }
        while(id < n-1 && a[id+1]-(id+2) < t){
            id++;
        }
        ans[k[i].second] = t+id+1;
    }

    rep(i, 0, q){
        cout << ans[i] << endl;
    }

    
    return 0;
    
}