#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int i = 0, n, l = 0, k = 0, b = 0, c = 0, e, x, j, m, d, t = 0,
                sum = 0, f = 0, o, z = 0, h = 0, y, r, x1, x2, y1, y2;
  cin >> n >> k;
  vector<long long int> v, v1;
  for (i = 1; i < n + 1; i++) {
    v.push_back(i);
  }
  for (i = 0; i < k; i++) {
    cin >> x;
    v1.push_back(x);
  }
  j = 0;
  z = n;
  for (i = 0; i < k; i++) {
    l = v1[i] % n;
    cout << v[(j + l) % n] << " ";
    v.erase(v.begin() + (j + l) % n);
    if ((j + l) % n == n - 1)
      j = 0;
    else
      j = (j + l) % n;
    n = n - 1;
  }
}
