#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n;
  int q;
  cin >> n >> q;
  for (int i = 0; i < q; i++) {
    long long int x;
    cin >> x;
    long long int l = 1;
    long long int r = n;
    while (x % 2 != 1) {
      long long int d = (r - l + 1) / 2;
      if (l % 2 == 0) d = (r - l + 2) / 2;
      x = r + 1 + ((x - l) / 2);
      l = r + 1;
      r += d;
    }
    cout << (x + 1) / 2 << '\n';
  }
  return 0;
}
