# include <bits/stdc++.h>
using namespace std;
typedef long long int ll;

int main(){
    ll n,q;
    cin>>n>>q;
    ll arr[n];
    for(ll i=0;i<n;i++) cin>>arr[i];
    sort(arr,arr+n);
    vector <ll> total_elements(n,0);
    total_elements[0]=arr[0]-1;
    ll sum = total_elements[0];
    for(ll i=1;i<n;i++){
        total_elements[i]+=arr[i]-arr[i-1]-1+total_elements[i-1];
    }
    cout<<"\n";
    while(q--){
        ll k;
        cin>>k;
        if (total_elements[0]>=k){
            cout<<k<<"\n";
            continue;
        }
        else if (k>total_elements[n-1]){
            cout<<arr[n-1]+(k-total_elements[n-1])<<"\n";
            continue;
        }
        else{
            ll idx = lower_bound(total_elements.begin(),total_elements.end(),k)-total_elements.begin();
            cout<<arr[idx-1]+(k-total_elements[idx-1])<<"\n";
        }
    }
    return 0;
}
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main() {
  int n , q;
  cin >> n >> q;
  vector<long long> a(n);
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  while (q--) {
    long long k;
    cin >> k;
    long long ok = (long long)(2e18);
    long long ng = 0;
    while (ok - ng > 1) {
      long long mid = (ok + ng) / 2;
      int it = upper_bound(a.begin() , a.end() , mid) - a.begin();
      if (mid - it >= k) ok = mid;
      else ng = mid;
    }
    cout << ok << endl;
  }
  return 0;
}