/**
 * code generated by JHelper
 * More info: https://github.com/AlexeyDmitriev/JHelper
 * @author
 */

#include <iostream>
#include <fstream>

#ifndef PRELUDE_H
#define PRELUDE_H

#define M_PI 3.14159265358979323846
#define EPS 1e-9

#include <algorithm>
#include <cmath>
#include <numeric>

#include <vector>
#include <set>
#include <map>
#include <queue>

#include <iostream>
#include <iomanip>
#include <string>
#include <sstream>

typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;

typedef std::pair<int, int> ii;
typedef std::pair<ll, ll> llll;
typedef std::pair<int, ll> ill;
typedef std::pair<double, double> dd;

typedef std::vector<int> vi;
typedef std::vector<ii> vii;
typedef std::vector<vi> vvi;
typedef std::vector<vvi> vvvi;
typedef std::vector<vii> vvii;
typedef std::vector<ill> vill;
typedef std::vector<vill> vvill;

typedef std::vector<bool> vb;

typedef std::vector<char> vc;
typedef std::vector<std::vector<char>> vvc;

typedef std::vector<ll> vll;
typedef std::vector<vll> vvll;
typedef std::vector<llll> vllll;
typedef std::vector<double> vd;
typedef std::vector<dd> vdd;

typedef std::string ss;
typedef std::vector<ss> vss;
typedef std::vector<vss> vvss;

typedef std::set<int> si;
typedef std::set<ii> sii;
typedef std::set<ll> sll;

typedef std::map<int, int> mii;
typedef std::map<char, int> mci;

typedef std::queue<int> qi;

typedef std::vector<std::pair<int, ii>> EdgeList;

#define REP(i,n) for(int i=0;i<n;++i)
#define DEBUG(a) #a << ": " << (a) << " " <<
#define ENDL "\n"
#define REPLL(l,n) for(ll l=0;l<n;++l)
#define FOR(i,s,n) for(int i=s;i<=n;++i)
#define FOREACH(it,a) for(auto it=a.begin(); it != a.end(); ++it)

#endif //PRELUDE_H


class DKthExcluded {
public:
    void solve(std::istream& in, std::ostream& out) {
        int n, q;
        in >> n >> q;
        vll a(n);
        REP(i, n) {
            in >> a[i];
        }
        std::sort(a.begin(), a.end());
        vllll k(q);
        REP(i, q) {
            ll ki;
            in >> ki;
            k[i] = llll(ki, i);
        }
        std::sort(k.begin(), k.end());

        vll ans(q);
        int extra = 0;
        REP(i, q) {
            auto [query, index] = k[i];
            while (extra < n && query+extra >= a[extra]) {
                extra++;
            }
            ans[index] = query+extra;
        }

        FOREACH(it, ans) {
            out << *it << ENDL;
        }

    }
};


int main() {
	std::ios_base::sync_with_stdio(false);
	std::cin.tie(NULL);
	std::cout << std::fixed;
	std::cout << std::setprecision(15);

	DKthExcluded solver;
	std::istream& in(std::cin);
	std::ostream& out(std::cout);
	solver.solve(in, out);
	return 0;
}

#include <bits/stdc++.h>
 
using namespace std;
typedef long long ll;
typedef vector<int> VI;
typedef vector<long long> Vll;
ll mm=1000000000;ll MM=mm+7;
#define rep(i, n) for(int i=0;i<n;i++)
#define PI 3.141592653589793
 


int main(){
 ll n,q;
 cin  >> n >> q;
 Vll a(n);
 rep(i,n)cin >> a[i];
 sort(a.begin(),a.end());
 Vll ans(q);
 rep(i,q){
  ll k;
  cin >> k;
  ll r=n-1;
  ll l=0;
  ll cs;
  if(k<a[0])ans[i]=k;
  else if(k>=a[n-1])ans[i]=k+n;
  else{
  while(r-l>1){
      cs=(r+l)/2;
      if(a[cs]<=k)l=cs;
      else r=cs;
  }
  ll nund=l;
  ll und=-1;
  while(und!=nund){
      k+=nund-und;
      und=nund;
      if(k>=a[n-1]){
          k+=n-1-und;
          break;
      }
      ll r=n-1;
      ll l=0;
      ll cs;
      while(r-l>1){
      cs=(r+l)/2;
      if(a[cs]<=k)l=cs;
      else r=cs;
      }
      nund=l;
  }   
  ans[i]=k;
  }
 }
 rep(i,q)cout << ans[i] << endl;

}









