#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int TESTS = 1;
  while (TESTS--) {
    int l = 1, n, k, m;
    cin >> n >> k;
    m = n;
    vector<long long int> b(n + 1);
    for (long long int i = 1; i < n + 1; i++) b[i] = i;
    vector<long long int> a(k);
    for (long long int i = 0; i < k; i++) cin >> a[i];
    for (long long int i = 0; i < k; i++) {
      int f = l + a[i];
      l = f;
      f %= m;
      l %= m;
      if (l == 0) l += m;
      if (f == 0) f += m;
      cout << b[f] << " ";
      b.erase((b.begin()) + f);
      l = f;
      m--;
    }
  }
  return 0;
}
