#include <bits/stdc++.h>
#pragma warning(disable : 4996)
using namespace std;
int main() {
  unsigned long long n;
  int q;
  cin >> n >> q;
  for (int i = 0; i < q; i++) {
    unsigned long long x;
    cin >> x;
    x--;
    unsigned long long l = 1, r = n - 1;
    while (x & 1 && x != 2 * (n - 1) - 1) {
      unsigned long long tr = (r - l + 1) / 2 + r;
      unsigned long long tl = r + (int)(r % 2 == 0);
      if (x != r) x = r + (x - l) / 2 + 1;
      r = tr;
      l = tl;
      if (l > r) x = 2 * (n - 1) - 1;
    }
    if (x == 2 * (n - 1) - 1) x++;
    cout << x / 2 + 1 << '\n';
  }
  return 0;
}
