#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define REP(i,m,n) for (int i = (m); i < (n); ++i)
#define rrep(i,n) for (int i = (n)-1; i >= 0; --i)
#define RREP(i,m,n) for (int i = (n)-1; i >= (m); ++i)
#define all(a) (a).begin(),(a).end()
#define rall(a) (a).rbegin(),(a).rend()
using namespace std;
using ll = long long int;
using vec = vector<ll>;
using P = pair<int,int>;
const int INF = 1e9+7;

int main() {
  int n, qq; cin >> n >> qq;
  vec a(n), b(n);
  rep(i,n) cin >> a[i];
  sort(all(a));
  b[0] = a[0]-1;
  REP(i,1,n) {
    b[i] = a[i] - a[i-1] - 1 + b[i-1];
  }
  rep(q,qq) {
    ll k; cin >> k;

    if (k <= b[0]) {
      cout << k << endl;
      continue;
    }

    int j = upper_bound(all(b), k-1) - b.begin() - 1;
    cout << k - b[j] + a[j] << endl;
  }
}

#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define mem(x,y) memset(x,y,sizeof(x))
#define pb push_back
#define mem(x,y) meset(x,y,sizeof(x))

ll len = 1e10;
string pat = "110";

int main()
{
    ll i,j,k,s,d,r,m,n,l;
    cin>>n;
    string line;
    cin>>line;

    if(n==1)
    {
        if(line=="0")   cout<<len<<endl;
        else            cout<<2*len<<endl;
        return 0;
    }

    if(line[0]=='1' && line[1]=='1') j = 0;
    else if(line[0]=='1' && line[1]=='0') j = 1;
    else j = 2;

    for(i=0, d=0; i<n; i++, j++)
    {
        j = j%3;
        if(line[i] != pat[j]) d++;
    }
    if(d)
    {
        cout<<"0\n";
        return 0;
    }



    for(i=0, s=0; i+2<n; i++)
    {
        if(line[i]==pat[0] && line[i+1]==pat[1] && line[i+2]==pat[2]) s++;

        //cout<<(line[i]==pat[0]) <<" "<< (line[i+1]==pat[1]) <<" "<< (line[i+2]==pat[2])<<endl;
    }
    if(line[0]!='1' || line[1]!='1')    s++;
    if(line[n-1] != '0')                s++;

    cout<<len-s+1<<endl;
}


