#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long n;
  int q;
  cin >> n >> q;
  long long index;
  for (int i = 0; i < q; i++) {
    cin >> index;
    if (index % 2 == 1) {
      cout << (index + 1) / 2 << '\n';
    } else {
      long long turn = n - index / 2;
      while (turn % 2 == 0) {
        turn = turn / 2;
      }
      long long temp = (turn + 1) / 2;
      cout << n - temp + 1 << '\n';
    }
  }
}
