#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
using ull1d = vector<ull>;
using ull2d = vector<ull1d>;
using ull3d = vector<ull2d>;
#define loop(i,n) for(ull i=0;i<n;i++)
#define rloop(i,n) for(ll i=n-1;i>=0;i--)
#define all(vec) vec.begin(),vec.end()
template<class T> inline bool chmin(T& a,T b){ if(a>b){ a=b; return true;} return false; }
template<class T> inline bool chmax(T& a,T b){ if(a>b){ a=b; return true;} return false; }

int main(){ cout << fixed << setprecision(15);
  ll n,q;
  cin >> n >> q;
  ull1d v(n+1,0);
  loop(i,n){ cin >> v[i+1]; }
  loop(i,q){
    ll k; cin >> k;
    // cout << "===" << endl;
    if(v[1]-1 >= k){ cout << k << endl; continue; }
    if(v[n]-n < k){ cout << k+n << endl; continue; }
    // cout << k << endl;
    ll ok=n, ng=-1;
    while(abs(ok - ng) > 1){
      ll mid = (ok + ng)/2;
      // cout << mid << " " << v[mid]-(mid) << endl;
      // v[i]-i 個が異なる
      if(v[mid]-mid >= k){ ok = mid; }
      else{ ng = mid; }
    }
    ok--;
    // cout << "---" << endl;
    // cout << ok << " " << v[ok] << endl;
    cout << k+ok << endl;
  }
  return 0;
}
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <cmath>
#define int long long
using namespace std;

namespace model{
	const int N = 1e6+7,P=998244353;
	int read()
	{
		int a = 0,x = 1;char ch = getchar();
		while(ch > '9' || ch < '0') {if(ch == '-') x = -1;ch = getchar();}
		while(ch >= '0' && ch <= '9'){a = a*10 + ch-'0';ch = getchar();}
		return a*x;
	}
	int fpow(int a,int x,int p) 
	{
		if(x == 1) return a;
		if(x == 0) return 1;
		int t = fpow(a,x>>1,p);
		if(x&1) return t*t%p*a%p;
		return t*t%p;
	}
	void Mod(int &a) {if(a >= P) a %= P;}
}

using model::read;
using model::N;

int n,q,a[N]; 

void solve()
{
	n = read(),q = read();
	for(int i = 1;i <= n;i ++) a[i] = read();
	sort(a+1,a+1+n);n = unique(a+1,a+1+n) - a-1;
	for(int i = 1;i <= q;i ++) {
		int x = read();
		int l = 1,r = x+n,mid;
		while(l<r) {
			mid = l+r>>1;
			int tmp = mid - (lower_bound(a+1,a+1+n,mid+1) - 1 - a);
			if(tmp >= x) r = mid;
			else l = mid+1;
		}
		printf("%lld\n",l);
	}
}

signed main()
{
	int t = 1;
	while(t --) solve();
}