#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
 
int main() {
    int N, Q;
    cin >> N >> Q;
    vector<long long> A(N);
    for (auto& x : A) {
        cin >> x;
    }
    vector<long long> low(N);
    for (int i = 0; i < N; ++i) {
        low[i] = A[i] - (i + 1);
    }
    while (Q--) {
        long long K;
        cin >> K;
        const int idx = lower_bound(low.begin(), low.end(), K) - low.begin();
        if (idx == N) {
            cout << A[N - 1] + (K - low[N - 1]) << '\n';
        } else {
            cout << A[idx] - (low[idx] - K + 1) << '\n';
        }
    }
    return 0;
}
#include <algorithm>
#include <cmath>
#include <iostream>
#include <map>
#include <set>
#include <string>
#include <unordered_map>
#include <vector>
using namespace std;
using LL = long long;
using ULL = unsigned long long;
using IntPair = pair<int, int>;
using ULLPair = pair<ULL, ULL>;

#define scast static_cast
#define repeat( itr, init, count ) \
for ( LL itr = ( init ); itr < ( count ); ++itr )
#define repeatu( itr, init, count ) \
for ( ULL itr = ( init ); itr < ( count ); ++itr )

ULL CountOverNums( const vector<ULL> *A, ULL key )
{
	auto itr = upper_bound( A->begin(), A->end(), key );
	if ( itr == A->end() )
	{
		return scast<ULL>( A->size() );
	}
	// else

	size_t pos = distance( A->begin(), itr );
	
	ULL count = scast<ULL>( pos );
	if ( *itr == key ) { count++; }
	return count;
}

int main()
{
	int N, Q;
	cin >> N >> Q;

	// 1, 2, 3, ...
	vector<ULL> A;
	A.resize( N );

	ULL startNum = 0;
	{
		ULL tmp;
		ULL sliceLeft = 0;
		repeatu( i, 0, N )
		{
			cin >> tmp;

			if ( startNum+1 == tmp )
			{
				startNum++;
			}

			A[i] = tmp - sliceLeft;
			sliceLeft++;
		}
	}

	vector<ULL> K;
	K.resize( Q );
	{
		ULL tmp;
		repeatu( i, 0, Q )
		{
			cin >> tmp;
			// K[i] = startNum + tmp + CountOverNums( &A, tmp );
			K[i] = tmp + CountOverNums( &A, tmp );
		}
	}

	repeatu( i, 0, Q )
	{
		cout << K[i] << endl;
	}


	//int _pause_thread_ = 0; cin >> _pause_thread_;
	return 0;
}
