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