#include <bits/stdc++.h>
using namespace std;
signed main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  long long n, k;
  cin >> n >> k;
  long long a[k + 1];
  for (long long i = 1; i <= k; ++i) cin >> a[i];
  long long now = 1;
  set<long long> out;
  for (long long i = 1; i <= k; ++i) {
    long long p = now;
    a[i] %= n - out.size();
    while (a[i]--) {
      ++p;
      if (p > n) p = 1;
      while (out.count(p)) {
        ++p;
        if (p > n) p = 1;
      }
    }
    out.insert(p);
    cout << p << ' ';
    now = p + 1;
    if (now > n) now = 1;
    while (out.count(now)) {
      ++now;
      if (now > n) now = 1;
    }
  }
  return 0;
}
