//Author: AnandRaj doubleux
#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef long double ld;
typedef pair<int,int> pii;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<pii> vpii;
typedef pair<ll,ll> pll;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef vector<pll> vpll; 

#define fastio ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define test() int t;cin>>t;while(t--)
#define all(v) v.begin(),v.end()
#define prinp(p) cout<<p.first<<" "<<p.second<<endl
#define prinv(V) for(auto v:V) cout<<v<<" ";cout<<endl
#define take(V,f,n) for(int in=f;in<f+n;in++) cin>>V[in]
#define what(x) cerr<<#x<<" = "<<x<<endl
#define KStest() int t,t1;cin>>t;t1=t;while(t--)
#define KScout cout<<"Case #"<<t1-t<<": "
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
const int MOD = 1e9+7,MAX = 1e6+5;
const ll INF = 1e18+5;

int main()
{
	int n,q;
	cin>>n>>q;
	vl A(n);
	take(A,0,n);
	sort(all(A));
	while(q--)
	{
		ll k;
		cin>>k;
		ll low = 0, high = 2e18;
		ll ans=-1;
		while(low<=high)
		{
			ll mid = low + (high-low)/2;
			int smol = 0;
			int l = 0, h = n-1;
			while(l<=h)
			{
				int m = l + (h-l)/2;
				if(A[m]<=mid)
				{
					smol = m+1;
					l = m+1;
				}
				else h = m-1;
			}
			if(mid - smol >=k)
			{
				ans = mid;
				high = mid-1;
			}
			else low = mid+1;
		}
		cout<<ans<<endl;
	}
}	
#include<bits/stdc++.h>
#define int long long
using namespace std;
int a[100010],n,q;
signed main(){
	cin>>n>>q;
	for(int i=1;i<=n;i++){
		cin>>a[i];
	}
	sort(a+1,a+1+n);
	for(int i=1;i<=n;i++){
		a[i]-=i;
	}
	while(q--){
		int k;
		cin>>k;
		int rk=lower_bound(a+1,a+n+1,k)-a-1;
		if(rk==n+1){
			cout<<k+n<<endl;
		}else{
			cout<<k+rk<<endl;
		}
	}
}