#include <bits/stdc++.h>
using namespace std;
using llong = long long;
using ullong = unsigned long long;

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

	vector<ullong> A(N);
	for (auto &x: A) cin >> x;
	sort(A.begin(), A.end());

	for (int q = 0; q < Q; ++q) {
		ullong K;
		cin >> K;
		ullong target = K;

		size_t d1 = 0;
		while (true) {
			auto pos = lower_bound(A.begin(), A.end(), target);
			size_t d2 = distance(A.begin(), pos);
			ullong num = 0;

			if (d1 == d2) {
				if (*pos == target) {
					num = d2 + 1;
				}
				else {
					cout << target << endl;
					break;
				}
			}
			else {
				if (*pos == target)
					num = d2 + 1;
				else
					num = d2;
			}
			d1 = d2;
			target = K + num;
		}
	}
	
}

#include<iostream>
#include<bits/stdc++.h>
using namespace std;
long long int missingK(long long int arr[],int n, long long int k)
{
  long long int l = 0, u = n - 1, mid;
  while(l <= u)
  {
    mid = (l + u)/2;
    long long int numbers_less_than_mid = arr[mid] - (mid + 1);
    if(numbers_less_than_mid == k)
    {
      if(mid > 0 && (arr[mid - 1] - (mid)) == k)
      {
        u = mid - 1;
        continue;
      }
      return arr[mid]-1;
    }
    if(numbers_less_than_mid < k)
    {
      l = mid + 1;
    }
    else if(k < numbers_less_than_mid)
    {
      u = mid - 1;
    }
  }
 
  if(u < 0)
    return k;

  long long int less = arr[u] - (u + 1);
  k -= less;

  return arr[u] + k;
}
int main(){
  int n,q;
  cin>>n>>q;
  long long int a[n];
  for(int i=0;i<n;i++)
    cin>>a[i];
  long long int k;
  while(q--){
      cin>>k;
      cout<<missingK(a,n,k)<<endl;
  }
}