#include <bits/stdc++.h>
using namespace std;
const int MAXN = 110;
int pv[MAXN], nx[MAXN];
void del(int x) {
  nx[pv[x]] = nx[x];
  pv[nx[x]] = pv[x];
}
int main() {
  int n, k;
  scanf("%d%d", &n, &k);
  int left = n;
  for (int i = 1; i <= n; i++) {
    pv[i] = i - 1;
    nx[i] = i + 1;
  }
  pv[1] = n;
  nx[n] = 1;
  int cur = 1;
  while (k--) {
    int x;
    scanf("%d", &x);
    x %= left;
    while (x--) cur = nx[cur];
    printf("%d\n", cur);
    del(cur);
    cur = nx[cur];
    left--;
  }
  return 0;
}
