#include <bits/stdc++.h>
using namespace std;
const int inf = (int)1e9 + 7;
const int N = (int)1e5 + 7;
long long n, q, x;
int main() {
  scanf("%I64d%I64d", &n, &q);
  while (q--) {
    scanf("%I64d", &x);
    if (x % 2 == 1)
      printf("%I64d\n", ((x + 1) / 2));
    else {
      long long o = x / 2;
      o = (n - o);
      while (o % 2 == 0) {
        o /= 2;
      }
      printf("%I64d\n", (n - (o + 1) / 2 + 1));
    }
  }
}
