#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n, q, x, i, j, k, a, b, c, res, p, t, h, ost;
  cin >> n >> q;
  for (h = 1; h <= q; h++) {
    cin >> x;
    p = 1;
    k = n;
    t = x;
    ost = n;
    while (1) {
      if (t % 2 == 1) {
        res = t / 2 + 1;
        break;
      } else {
        b = (k - p + 1) / 2;
        if (k % 2 == 1 && p % 2 == 1) b++;
        ost = ost - b;
        a = (t - p + 1) / 2;
        if (p % 2 == 0 && t % 2 == 0) a++;
        p = k + 1;
        k = k + ost;
        x = a;
        t = p + x - 1;
      }
    }
    cout << res << endl;
  }
  return 0;
}
