#include <bits/stdc++.h>
using namespace std;
int a[10050];
void brute(int n) {
  for (int i = 0; i < n; ++i) {
    a[1 + i * 2] = i + 1;
  }
  int last = n * 2 - 1;
  int emptyPtr = last - 1;
  while (emptyPtr > 0) {
    a[emptyPtr] = a[last];
    a[last] = 0;
    --last;
    while (a[emptyPtr] != 0) {
      --emptyPtr;
    }
  }
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(nullptr);
  cout.tie(nullptr);
  long long n;
  int q;
  cin >> n >> q;
  for (int i = 1; i <= q; ++i) {
    long long x;
    cin >> x;
    long long bound = n;
    long long before = (x - 1) / 2;
    long long lastN = n / 2;
    while (x % 2 == 0 && lastN != 0) {
      x = bound + before + 1;
      bound += lastN;
      if (bound % 2 == 0) {
        lastN = (lastN + 1) / 2;
      } else {
        lastN = lastN / 2;
      }
      before /= 2;
    }
    cout << (x + 1) / 2 << "\n";
  }
  return 0;
}
