#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k;
  scanf("%d %d", &n, &k);
  vector<long long int> v;
  vector<long long int>::iterator it;
  long long int a[k], i, j, c, t, x;
  for (i = 0; i < k; i++) scanf("%lld", &a[i]);
  for (i = 1; i <= n; i++) v.push_back(i);
  c = 0;
  for (i = 0; i < k; i++) {
    c = (c + a[i]) % (n);
    cout << v[c] << " ";
    v.erase(v.begin() + c);
    n--;
  }
  return 0;
}
