#include <bits/stdc++.h>

using namespace std;
using ll = long long;
using P = pair<ll, ll>;
const ll MOD = 1e9 + 7;
const ll INF = (1ll << 60);

template <typename T>
bool chmax(T &a, const T &b)
{
    if (a < b)
    {
        a = b;
        return true;
    }
    return false;
}

template <typename T>
bool chmin(T &a, const T &b)
{
    if (a > b)
    {
        a = b;
        return true;
    }
    return false;
}

int main(void)
{
    ll n, q;
    cin >> n >> q;
    vector<ll> a(n);

    for (int i = 0; i < n; i++)
    {
        cin >> a[i];
    }

    sort(a.begin(), a.end());

    for (int i = 0; i < q; i++)
    {
        ll k;
        cin >> k;

        ll l = -1, r = INF;

        while (r - l > 1)
        {
            ll mid = (r + l) / 2;

            auto x = lower_bound(a.begin(), a.end(), mid) - a.begin();

            x = mid - x;

            if (x > k)
            {
                r = mid;
            }
            else
            {
                l = mid;
            }
        }

        cout << l << endl;
    }
}
#include <bits/stdc++.h>
#define MAXN 500005
#define ll long long
#define F first
#define S second
#define MOD 1000000007
#define ll long long

using namespace std;

int n, q;
ll a[MAXN], b[MAXN];

void solve()
{
    cin >> n >> q;
    for(int i = 1; i <= n; ++i) cin >> a[i], b[i] = a[i] - i;
    for(int i = 1; i <= q; ++i)
    {
        ll x;

        cin >> x;

        int pos = lower_bound(b + 1, b + n + 1, x) - b;

        if(pos == n + 1)
        {
            cout << a[n] + (x - b[n]) << '\n';
        }
        else
        {
            cout << a[pos] - (b[pos] - x + 1) << '\n';
        }

    }
}


int main()
{
    ios_base :: sync_with_stdio(0);
    cin.tie();
    cout.tie();
    if(fopen(".inp", "r"))
    {
        freopen(".inp", "r", stdin);
        freopen(".out", "w", stdout);
    }
    int t;
    t = 1;
    //cin >> t;
    while(t--)
    {
        //cerr << t << '\n';
        solve();
    }
    return 0;
}
