#include <bits/stdc++.h>
FILE *in = stdin, *out = stdout;
using namespace std;
long long int n;
int main() {
  fscanf(in, "%lld", &n);
  int Q;
  fscanf(in, "%d", &Q);
  for (int q = 1; q <= Q; q++) {
    long long int x;
    fscanf(in, "%lld", &x);
    if (x % 2 == 1) {
      fprintf(out, "%lld\n", (x + 1) / 2);
      continue;
    }
    long long int j = n - 1 - (x / 2 - 1), sum = j;
    while (true) {
      x += j;
      if (j % 2 == 1) break;
      j /= 2;
    }
    fprintf(out, "%lld\n", (x + 1) / 2);
  }
  return 0;
}
