#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n;
  int q;
  cin >> n >> q;
  while (q--) {
    long long x;
    scanf("%I64d", &x);
    long long len = n, cur = n, pre = 0;
    while (x % 2 == 0) {
      x = cur + (x - pre + 1) / 2;
      if (len % 2 == 1 && cur % 2 == 0)
        len = len / 2 + 1;
      else
        len = len / 2;
      pre = cur;
      cur += len;
    }
    printf("%I64d\n", x + 1 >> 1);
  }
  return 0;
}
