#include <bits/stdc++.h>
const int md = 1e9 + 7, inf = 1e9 + 7;
const long long hs = 199;
const long double eps = 1e-9, pi = acos(-1);
using namespace std;
long long calc(long long ind, long long lo, long long hi) {
  if (ind & 1) return ind / 2 + 1;
  long long nlo = hi + 1;
  lo += (lo & 1);
  hi -= (hi & 1);
  long long nhi = nlo + (hi - lo) / 2;
  ind = nlo + (ind - lo) / 2;
  return calc(ind, nlo, nhi);
}
long long n, x;
int q;
int main() {
  ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  cin >> n >> q;
  while (q--) {
    cin >> x;
    cout << calc(x, 1, n) << '\n';
  }
}
