/*Created By:---- Dibas Behera*/
#include<bits/stdc++.h>
using namespace std;

#define db(x) cout<<x<<'\n'
#define db1(x) cout<<#x<<"="<<x<<'\n'
#define db2(x,y) cout<<#x<<"="<<x<<","<<#y<<"="<<y<<'\n'
#define db3(x,y,z) cout<<#x<<"="<<x<<","<<#y<<"="<<y<<","<<#z<<"="<<z<<'\n'
#define repi(i,n) for(int i=0;i<(n);++i)
//#define repA(i,a,n) for(int i=a;i<=(n);++i)
//#define repD(i,a,n) for(int i=a;i>=(n);--i)
#define ll long long int
#define endl '\n'
#define lld long long double
#define vi vector<int> 
#define vl vector<ll> 
#define vb vector<bool> 
#define vvi vector<vector<int>  >
#define err(t) cout<<"Error : "<<t<<endl;
#define all(v) v.begin(),v.end()
#define mp make_pair
#define M 100000
#define MD 1000000007 //998244353
#define pb push_back
#define rep(i,a,b) for(ll i = a; i <= (b); i++)
#define pii pair<int,int>
#define pll pair<ll,ll> 
#define vec(a) vector<a >
#define se second
#define fi first
#define inf 0xffffffff
#define inchar getchar_unlocked
#define outchar(x) putchar_unlocked(x)

#define goo(x)	cout<<"Case #"<<(x)<<": ";
//template <typename T>
//using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
ll binpow(ll a,ll b){	if(a==0) return 0; if(b==0) return 1;ll ans=1;while(b>0){if(b&1) ans=ans*a; a=a*a; b=b>>1;}	return ans;}
ll binpowM(ll a,ll b,ll m=MD){	if(a==0) return 0; if(b==0) return 1;ll ans=1;while(b>0){if(b&1) ans=ans*a;ans%=m; a=a*a;a%=m; b=b>>1;}	return ans;}
template <typename T> 
T Min(T a,T b){ return a<b?a:b; }
template <typename T>
T Max(T a,T b){ return a>b?a:b; }

//-------------------------------------------
bool pred(ll p,ll &k,vector<ll> &a){
 	ll x=upper_bound(all(a),p)-a.begin();
  return p-x<=k;
}
bool pred2(ll p,ll &k,vector<ll> &a){
 	ll x=upper_bound(all(a),p)-a.begin();
  return p-x>=k;
}
ll bin(ll &k,vl &a){
 ll lo=k,hi=1e18+1e6,mid;
  while(lo+1<hi){
    mid=lo+(hi-lo+1)/2;
    if(pred(mid,k,a)) lo=mid;
    else hi=mid;
  }
  hi=lo;
  lo=0;
  while(lo+1<hi){
    mid=lo+(hi-lo+1)/2;
    if(pred2(mid,k,a)) hi=mid;
    else lo=mid;
  }
  return hi;
}
 unordered_map<ll,ll> m;
int32_t main(){
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);cout.tie(NULL);
	// int n;cin>>n;
	// string s;cin>>s;
	
	//ll n;cin>>n; vl a(n); repi(i,n) cin>>a[i];
	int n,q;cin>>n>>q;
  	vl a(n);repi(i,n) cin>>a[i];
  sort(all(a));
  
  //else 
  
	//int test1;cin>>test1;
  while(q--){ 
		ll k;cin>>k;
      	cout<<bin(k,a)<<'\n';
	 }
	 //*/
return 0;
}

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


signed main() {
 
    ios::sync_with_stdio(0);
    cin.tie(0);
    
    #ifndef ONLINE_JUDGE
        freopen("sp.txt","r",stdin);
    #endif
    
    int n,q;
    cin>>n>>q;
    vector<int>v(n);
    for(int i=0;i<n;i++) cin>>v[i];
    while(q--){
        int k;
        cin>>k;
        int l=1;
        int r=2e18;
        int ans=-1;
        while(l<r){
            int mid=(l+r)>>1;
            int idx=upper_bound(v.begin(),v.end(),mid)-v.begin();
            int z=mid-idx;
            //cout<<mid<<' '<<z<<'\n';
            if(z>=k){
                ans=mid;
                r=mid;
            }
            else{
                l=mid+1;
            }
        }
        cout<<ans<<'\n';
    }
    return 0;
}