#include <bits/stdc++.h>
using namespace std;
const int INF = 0x3f3f3f3f;
const int MOD = 1e9 + 7;
const int MAXN = 2e5 + 5;
long long n, x, a, b;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int T;
  cin >> n >> T;
  while (T--) {
    cin >> x;
    if (x & 1)
      cout << x / 2 + 1 << endl;
    else {
      a = n, b = n - 1, x /= 2;
      while (~(a + x) & 1) {
        a += (b + 1) / 2;
        b /= 2;
        x = (x + 1) / 2;
      }
      cout << (a + x) / 2 + 1 << endl;
    }
  }
  return 0;
}
