#include <bits/stdc++.h>
#define gc() getchar()
using namespace std;
typedef long long ll;

template <typename T> void rd(T &x){
	ll f=1;x=0;char c=gc();
	for(;!isdigit(c);c=gc())if(c=='-')f=-1;
	for(;isdigit(c);c=gc())x=(x<<1)+(x<<3)+(c^48);
	x*=f;
}

ll n,q,h[100010],ans;

inline void bsh(ll k){
	ll l=0,r=h[n]+k+1,mid,f;
	while(l+1<r){
		mid=l+r>>1;
		f=lower_bound(h+1,h+n+1,mid)-h-1;
		//printf("%lld %lld %lld %lld\n",l,r,mid,f);
		if(mid-f>k)r=mid;
		else l=mid;
	}
	printf("%lld\n",l);
}

int main(){
	rd(n),rd(q);
	for(ll i=1;i<=n;i++)rd(h[i]);
	for(ll i=1,t;i<=q;i++){
		rd(t);
		bsh(t);
	}
	return 0;
}

#include "bits/stdc++.h"
typedef long long int ll;
using namespace std;

int64_t  n, q;
void solve() {
    cin >> n >> q;
    vector<int64_t> a;
    for(int i=0;i<n;++i) {
        int64_t t;  cin >> t;
        a.push_back(t);
    }
    sort(a.begin(), a.end());
    for(int i=0;i<q;++i) {
        int64_t k; cin >> k;
        int64_t pre = 0;
        while(1) {
            int64_t cnt = upper_bound(a.begin(), a.end(), k) - upper_bound(a.begin(), a.end(), pre);
            if(cnt == 0)
                break;
            pre = k;
            k += cnt;
        }
        cout << k << "\n";
    }
}

int main() {
    ios_base::sync_with_stdio(false); cin.tie(0);
    int T = 1;
    while(T--) solve();
    return 0;
}

