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

#define rep(i,a,b) for(int i = a; i < (b);++i)
#define all(x) begin(x), end(x)
#define sz(x) (int) (x).size()

typedef long long ll;

const int MAX_N = 1e5+1;

ll a[MAX_N];

int main(){
    cin.tie(0)->sync_with_stdio(false);
    cin.exceptions(cin.failbit);
    int n,q;
    cin>>n>>q;
    for (int i = 0; i < n; i++){
        cin>>a[i];
    }
    sort(a,a+n);
    ll k;
    for (int i = 0; i < q; i++){
        cin>>k;
        ll lb = 0;ll ub = 1e18+1e6;
        while (lb < ub -1){
            ll mid = (lb+ub)/2;
            ll d = lower_bound(a,a+n,mid) - a;
            if(mid - d > k){
                ub = mid;
            }else{
                lb = mid;
            }
        }
        cout<<lb<<endl;
    }
    
    
    return 0;
}



#include <iostream>
#include <vector>
#include <algorithm>
#define rep(i,n) for (int i = 0; i < (n); ++i)
using namespace std;


using ll = long long;
using P = pair<int, int>;


void solve() {
    ll N, Q;
    cin >> N >> Q;
    vector<ll> A(N);
    for (size_t i = 0; i < N; i++)
    {
        cin >> A[i];
    }
    vector<ll> exceptA(N);
    ll pre = 0;

    for (ll i = 0; i < N; i++)
    {
        exceptA[i] = A[i] - i - 1;
    }

    vector<ll> ans;
    for (size_t i = 0; i < Q; i++)
    {
        ll k;
        cin >> k;
        if (k < A[0]) {
            ans.emplace_back(k);
            continue;
        }
        ll index = lower_bound(exceptA.begin(), exceptA.end(), k) - exceptA.begin();
        ll plus = k - exceptA[index - 1];
        ll ex_num = A[index - 1] + plus;
        ans.emplace_back(ex_num);

    }
    for (auto v : ans)cout << v << endl;
    //return 0;
}

int main()
{
    solve();
    return 0;
}

