#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k;
  scanf("%d %d", &n, &k);
  int a[k + 1];
  for (int i = 1; i <= k; i++) scanf("%d", &a[i]);
  int st = 0;
  vector<int> v;
  for (int i = 0; i < n; i++) v.push_back(i);
  int cur, temp;
  int sz = n;
  for (int i = 1; i <= k; i++) {
    temp = a[i] % sz;
    cur = (st + 1) % sz;
    cur = (cur + temp - 1) % sz;
    if (cur < 0) cur = (cur + sz) % sz;
    cout << v[cur] + 1 << " ";
    v.erase(v.begin() + cur);
    if (cur == sz - 1)
      st = 0;
    else
      st = cur;
    sz--;
  }
  cout << endl;
  return 0;
}
