#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, query;
  cin >> n >> query;
  for (long long i = 0; i < query; ++i) {
    long long a;
    cin >> a;
    a--;
    long long now_down = 0;
    long long now_size = n;
    while (now_size != 1) {
      if (now_down % 2 == 0) {
        if (a % 2 == 0) {
          cout << (2 + now_down + a) / 2 << endl;
          goto ok;
        }
        now_down += now_size;
        now_size /= 2;
        a /= 2;
      } else {
        if (a % 2 == 1) {
          cout << (2 + now_down + a) / 2 << endl;
          goto ok;
        }
        now_down += now_size;
        now_size++;
        now_size /= 2;
        a /= 2;
      }
    }
    cout << n << endl;
  ok:;
  }
  return 0;
}
