#include <stdint.h>
#include <bits/stdc++.h> 
#include <ext/pb_ds/assoc_container.hpp>

#define int long long
#define IOS std::ios::sync_with_stdio(false); cin.tie(NULL);cout.tie(NULL);//cout.precision(dbl::max_digits10);
#define pb(x) push_back(x)
#define mod 1000000007ll //998244353ll
#define vi vector<int>
#define v(x) vector< x >
#define lld long double
#define pii pair<int, int>
#define ff first
#define ss second 
#define endl "\n" 
#define all(x) (x).begin(), (x).end()
#define rep(i,x,y) for(int i=x; i<y; i++)   
#define repe(i,x,y) for(int i=x; i<=y; i++)    
#define fill(a,b) memset(a, b, sizeof(a))
#define setbits(x) __builtin_popcountll(x)
#define print2d(dp,n,m) for(int i=0;i<=n;i++){for(int j=0;j<=m;j++)cout<<dp[i][j]<<" ";cout<<"\n";}

typedef std::numeric_limits< double > dbl;
using namespace __gnu_pbds;
using namespace std;
lld pi=3.1415926535897932;

/*-----------------------------------------------------------*/

void solve(){
	int n,q;
	cin>>n>>q;
	int a[n];
	rep(i,0,n) cin>>a[i];
	sort(a,a+n);
	int b[n];
	b[0]=a[0]-1;
	rep(i,1,n){
		b[i]=b[i-1]+(a[i]-a[i-1]-1);
	}
	
	rep(i,0,q){
		int x;
		cin>>x;
		int ind = lower_bound(b,b+n,x)-b;
		if(ind!=n){
			cout<<a[ind]-(b[ind]-x+1)<<endl;
		}else{
			cout<<a[n-1]+(x-b[n-1])<<endl;
		}
	}
}

int32_t main(){
	IOS
	
	int t=1;
	// cin>>t;
	// while(t--)
	// if(solve())
	// cout<<"Yes"<<endl;
	// else
	// cout<<"No"<<endl;
	
	while(t--)
	solve();
	
	return 0;
}
#include<bits/stdc++.h>
using namespace std;
long long a,b,c,d[100001],v[100001],an[100001];
struct p
{
	long long q,w;
}m[100001];
bool cmp(p qq,p ww)
{
	return qq.q<ww.q;
}
int main()
{
	scanf("%lld%lld",&a,&b);
	for(int i=1;i<=a;i++)
	{
		scanf("%lld",&d[i]);
	}
	d[a+1]=2000000000000000000;
	for(int i=1;i<=b;i++)
	{
		scanf("%lld",&m[i].q);
		m[i].w=i;
	}
	sort(m+1,m+b+1,cmp);
	long long ll=1;
	for(int i=1;i<=b;i++)
	{
		while(d[ll]-ll<m[i].q) ll++;
		an[m[i].w]=m[i].q+ll-1;
	}
	for(int i=1;i<=b;i++)
	{
		printf("%lld\n",an[i]);
	}
	return 0;
}