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