#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back               
#define mp make_pair         
#define nline "\n"
const ll M1=1e9+7;                                               
const ll M2=998244353;                         
const ll N=100005; 
const ll INF_MUL=1e13;                                                   
const ll INF_ADD=1e18; 
#define f first                          
#define s second                                
#define pll pair<ll,ll>   
#ifndef ONLINE_JUDGE 
#define debug(x) cerr<<#x<<" "; _print(x); cerr<<nline;
#else
#define debug(x);
#endif  
void _print(ll x){cerr<<x;}    
template<class T,class V> void _print(pair<T,V> p) {cerr<<"{"; _print(p.first);cerr<<","; _print(p.second);cerr<<"}";}
template<class T>void _print(vector<T> v) {cerr<<" [ "; for (T i:v){_print(i);cerr<<" ";}cerr<<"]";}
template<class T>void _print(set<T> v) {cerr<<" [ "; for (T i:v){_print(i); cerr<<" ";}cerr<<"]";}
template<class T>void _print(multiset<T> v) {cerr<< " [ "; for (T i:v){_print(i);cerr<<" ";}cerr<<"]";}
template<class T,class V>void _print(map<T, V> v) {cerr<<" [ "; for(auto i:v) {_print(i);cerr<<" ";} cerr<<"]";} 
//--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
vector<ll> a; 
ll n; set<ll> check;
ll query(ll k){
    if(-a.back()>k)         
        return k;  
    ll start=1,end=1e18+1e6,ans=k;
    while(start<=end){
        ll mid=(start+end)/2;
        ll pos=a.end()-lower_bound(a.begin(),a.end(),-mid);
        ll left=mid-pos;
        ll found=0;
        if(check.count(mid))
            found=1;
        if(left>k){
            end=mid-1;   
        }
        else if(left<k)
            start=mid+1;
        else{   
            if(found){
                ans=mid-1;
                end=mid-1;  
            }
            else   
                return mid;
        }   
    }
    return ans;
}   
void solve(){         
    ll q; cin>>n>>q;
    for(ll i=1;i<=n;i++){
        ll x; cin>>x;
        a.pb(-x);
        check.insert(x);
    }
    sort(a.begin(),a.end());
    while(q--){
        ll k; cin>>k;
        cout<<query(k)<<nline;
    }
    return;     
}             
int main()                                               
{           
    ios_base::sync_with_stdio(false);                        
    cin.tie(NULL);                     
    #ifndef ONLINE_JUDGE            
    freopen("input.txt", "r", stdin);                                         
    freopen("output.txt", "w", stdout);  
    freopen("error.txt", "w", stderr);                        
    #endif    
    ll t=1;           
    //cin>>t;
    while(t--){  
        solve();
    }
    /*
    Correct data type?
    Infinity?
    Base case?
    */
    cerr<<"Time:"<<1000*((double)clock())/(double)CLOCKS_PER_SEC<<"ms\n"; 
} 
#include "bits/stdc++.h"
#define int long long
#define endl '\n'
using namespace std;
 
typedef long long ll;
typedef long double ld;
#define db(x) cerr << #x << ": " << x << '\n';
#define read(a) int a; cin >> a;
#define reads(s) string s; cin >> s;
#define readb(a, b) int a, b; cin >> a >> b;
#define readc(a, b, c) int a, b, c; cin >> a >> b >> c;
#define readarr(a, n) int a[(n) + 1] = {}; FOR(i, 1, (n)) {cin >> a[i];}
#define readmat(a, n, m) int a[n + 1][m + 1] = {}; FOR(i, 1, n) {FOR(j, 1, m) cin >> a[i][j];}

#define print(a) cout << a << endl;
#define printarr(a, n) FOR (i, 1, n) cout << a[i] << " "; cout << endl;
#define printv(v) for (int i: v) cout << i << " "; cout << endl;
#define printmat(a, n, m) FOR (i, 1, n) {FOR (j, 1, m) cout << a[i][j] << " "; cout << endl;}
#define all(v) v.begin(), v.end()
#define sz(v) (int)(v.size())
#define rz(v, n) v.resize((n) + 1);
#define pb push_back
#define fi first
#define se second
#define vi vector <int>
#define pi pair <int, int>
#define vpi vector <pi>
#define vvi vector <vi>
#define setprec cout << fixed << showpoint << setprecision(20);
#define FOR(i, a, b) for (int i = (a); i <= (b); i++)
#define FORD(i, a, b) for (int i = (a); i >= (b); i--)
const ll inf = 1e18;
const ll mod = 1e9 + 7;
const ll N = 2e5 + 1;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

int power (int a, int b = mod - 2)
{
    int res = 1;
    while (b > 0) {
        if (b & 1)
            res = res * a % mod;
        a = a * a % mod;
        b >>= 1;
    }
    return res;
}

signed main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	
    readb(n, q);
    readarr(a, n);
    vi v(n + 2);
    FOR (i, 1, n) v[i] = a[i] - i;
    v[n + 1] = inf;
    
    FOR (i, 1, q)
    {
        read(k);
        auto it = lower_bound(all(v), k);
        int x = it - v.begin() - 1;
        print(a[x] + k - v[x]);
    }
}












