#include <bits/stdc++.h>
using namespace std;
int main() {
  int k, n;
  cin >> k >> n;
  vector<int> cc;
  int leaderpos = 0;
  for (int i = 1; i <= k; i++) {
    cc.push_back(i);
  }
  vector<int> ques;
  for (int i = 0; i < n; i++) {
    int ans = 0;
    int aa;
    cin >> aa;
    int cnt = (aa + leaderpos) % cc.size();
    ques.push_back(cc[cnt]);
    cc.erase(cc.begin() + cnt);
    leaderpos = cnt;
  }
  for (int i = 0; i < ques.size(); i++) {
    if (i != ques.size() - 1) {
      cout << ques[i] << " ";
    } else {
      cout << ques[i];
    }
  }
  return 0;
}
