#include <bits/stdc++.h>
using namespace std;
vector<int> l;
int main() {
  int n, k;
  cin >> n >> k;
  for (int i = 0; i < n; i++) l.push_back(i + 1);
  int now = 0;
  while (k--) {
    int x;
    cin >> x;
    int y = (now + x) % l.size();
    cout << l[y];
    now = y;
    if (k) cout << " ";
    l.erase(l.begin() + y);
  }
  cout << endl;
  return 0;
}
