#include <bits/stdc++.h>
using namespace std;
int n, k;
int main() {
  cin >> n >> k;
  vector<int> v;
  for (int i = 0; i < n; i++) {
    v.push_back(i + 1);
  }
  for (int p = 0; p < k; p++) {
    int position;
    cin >> position;
    position %= int(v.size());
    if (p > 0) cout << " ";
    cout << v[position];
    vector<int> nextv;
    for (int j = 1; j < int(v.size()); j++)
      nextv.push_back(v[(position + j) % int(v.size())]);
    v = nextv;
  }
  cout << "\n";
  return 0;
}
