#include <bits/stdc++.h>
using namespace std;
inline long long rd() {
  long long x = 0, f = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    x = x * 10 + ch - '0';
    ch = getchar();
  }
  return x * f;
}
long long n, Q, x;
long long fd(long long x, long long lst, long long sz) {
  if (x & 1) return x + 1 >> 1;
  if (sz == 1) return x + 2 >> 1;
  long long tt = (x - lst + 1) >> 1, tl = lst;
  lst += sz;
  sz = (tl & 1 ? (sz + 1) >> 1 : sz >> 1);
  return fd(lst + tt, lst, sz);
}
int main() {
  n = rd();
  Q = rd();
  while (Q--) {
    x = rd();
    printf("%lld\n", fd(x, 0, n));
  }
  return 0;
}
