#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,sse3,sse4,popcnt,abm,mmx")
using namespace std;
const int N = 2e5 + 11, mod = 1e9 + 7, mod2 = 998244353;
const int MAX = 2e14;
const int INF1 = 2e9 + 11;
const long long INF2 = 2e18 + 11;
const int base = 500;
const int P = 31;
const int dx[] = {1, -1, 0, 0, 1, 1, -1, -1};
const int dy[] = {0, 0, 1, -1, 1, -1, 1, -1};
const double EPS = 1e-9;
const double E = 2.7182818284590452353602874713527;
const double PI = acos(-1.0);
template <typename T1, typename T2>
inline void chmin(T1 &a, T2 b) {
  if (a > b) a = b;
}
template <typename T1, typename T2>
inline void chmax(T1 &a, T2 b) {
  if (a < b) a = b;
}
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
long long n, q;
int main() {
  if (fopen("firesafe"
            ".in",
            "r"))
    freopen(
        "firesafe"
        ".in",
        "r", stdin),
        freopen(
            "firesafe"
            ".out",
            "w", stdout);
  cin >> n >> q;
  while (q--) {
    long long x;
    cin >> x;
    if (n == 1) {
      cout << "1\n";
      continue;
    }
    long long cur = n - 2;
    while (cur) {
      if (n - cur == x)
        x = n;
      else if (n - cur > x)
        break;
      else {
        long long diff = x - (n - cur);
        diff >>= 1;
        if (!diff) {
          --x;
          --cur;
          continue;
        }
        cur -= diff;
        x -= diff;
        continue;
      }
      --cur;
    }
    cout << x << "\n";
  }
  return 0;
}
