#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k;
  cin >> n >> k;
  vector<int> a(n);
  for (int i = 0; i < n; i++) a[i] = i + 1;
  int leader = 0;
  while (k--) {
    int hi;
    cin >> hi;
    int i = leader;
    i = (i + hi) % a.size();
    cout << a[i] << " ";
    leader = i;
    a.erase(a.begin() + i);
  }
}
