#include <bits/stdc++.h>
using namespace std;
namespace{
// Types
#define ll long long
#define ull unsigned long long
// Shortcuts
#define sp " "
#define endl "\n"
#define ft first
#define se second
#define pb push_back
#define pob pop_back
#define __Orion__ signed main()
#define TIME (1.0 * clock() / CLOCKS_PER_SEC)
#define fast ios::sync_with_stdio(0); cin.tie(0); cout.tie(0)
// Functions
#define sz(s) (s).size()
#define all(s) (s).begin(), (s).end()
#define FOR(i, a, b) for(int i = (a), _b = (b); i <= _b; i++)
#define FORD(i, a, b) for(int i = (a), _b = (b); i >= _b; i--)
#define file(a) freopen(a".INP", "r", stdin); freopen(a".OUT", "w", stdout)
// Const
const ll inf = 1e18;
const ll mod = 1e9 + 7;
const double pi = 3.1415926535897932384626433832795;
}
const int mx = 1e5 + 5;
int n, t;
ll ma, s[mx];
bool k[10000005];
//sub1
void solve1(){
vector<int> res; res.pb(0);
FOR(i, 1, n)
k[s[i]] = 1;
FOR(i, 1, 1e7) if(!k[i]) res.pb(i);
//for(auto x : res) cout << x << sp;
while(t--){
int tc; cin >> tc;
cout << res[tc] << endl;
}
}
//sub2
void solve2(){
while(t--){
ll tc; cin >> tc;
int i = 0;
while(1){
auto it = upper_bound(s + 1, s + n + 1, tc);
int pos = it - s - 1;
if(i == pos) break;
tc+=pos - i;
i = pos;
}
cout << tc << endl;
}
}
__Orion__{
fast;
//file("test1");
cin >> n >> t;
FOR(i, 1, n) cin >> s[i], ma = max(ma, s[i]);
sort(s + 1, s + n + 1);
if(ma <= 1e6) solve1();
else solve2();
cerr << "Time elapsed: " << TIME << sp << "s." << endl;
return (0 ^ 0);
}
I2luY2x1ZGUgPGJpdHMvc3RkYysrLmg+Cgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKbmFtZXNwYWNlewogICAgLy8gVHlwZXMKICAgICNkZWZpbmUgbGwgbG9uZyBsb25nCiAgICAjZGVmaW5lIHVsbCB1bnNpZ25lZCBsb25nIGxvbmcKCiAgICAvLyBTaG9ydGN1dHMKICAgICNkZWZpbm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