#include <bits/stdc++.h>
using namespace std;
inline void read(int &x) {
  short negative = 1;
  x = 0;
  char c = getchar();
  while (c < '0' || c > '9') {
    if (c == '-') negative = -1;
    c = getchar();
  }
  while (c >= '0' && c <= '9')
    x = (x << 3) + (x << 1) + (c ^ 48), c = getchar();
  x *= negative;
}
inline void write(long long x) {
  static long long sta[35];
  long long top = 0;
  do {
    sta[top++] = x % 10, x /= 10;
  } while (x);
  while (top) putchar(sta[--top] + 48);
  puts("");
}
bool prime(int n) {
  if (n == 0 || n == 1) return false;
  for (int i = 2; i * i <= n; i++)
    if (n % i == 0) return false;
  return true;
}
const int dx[] = {-1, 0, 1, 0};
const int dy[] = {0, -1, 0, 1};
int main() {
  int n, k;
  read(n);
  read(k);
  vector<long long> v;
  for (int i = 0; i < (int)(n); i++) v.push_back(i + 1);
  int p = 0;
  while (k--) {
    int a;
    read(a);
    a %= v.size();
    while (a--) p = (p + 1) % v.size();
    cout << v[p] << endl;
    vector<long long> av;
    for (int i = 0; i < (int)(v.size()); i++) {
      if (i != p) av.push_back(v[i]);
    }
    v = av;
    av.clear();
    if (p == v.size()) p = 0;
  }
  return 0;
}
