#include <bits/stdc++.h>
using namespace std;
long long str_to_int(string s) {
  long long k = 0;
  for (int i = 0; i < s.size(); i++) {
    k *= 10;
    k += s[i] - '0';
  }
  return k;
}
int gcd(int a, int b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
long long solve(long long poz, long long skok) {
  if (skok % 2) return poz + skok;
  if (skok % 2 == 0) {
    return solve(poz + skok, skok / 2);
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  long long n, m, q;
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    cin >> q;
    if (q % 2 == 1)
      cout << q / 2 + 1 << endl;
    else {
      if (solve(q, n - q / 2) == n * 2 - 1)
        cout << n << endl;
      else {
        cout << (solve(q, n - q / 2) + 1) / 2 << endl;
      }
    }
  }
}
