#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k;
  cin >> n >> k;
  int a[k], b[n];
  for (int i = 0; i < k; i++) {
    cin >> a[i];
  }
  for (int i = 1; i <= n; i++) {
    b[i] = i;
  }
  int d = 1;
  for (int i = 0; i < k; i++) {
    d = (d + a[i]) % n;
    if (d == 0) d = n;
    cout << b[d] << " ";
    for (int j = d; j < n; j++) {
      b[j] = b[j + 1];
    }
    --n;
  }
}
