#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int n, k;
  cin >> n >> k;
  vector<int> v(k);
  for (long long i = 0; i < k; i++) cin >> v[i];
  vector<int> cir(n);
  for (long long i = 1; i < n + 1; i++) {
    cir[i - 1] = i;
  }
  int lead = 1;
  for (long long i = 0; i < k; i++) {
    int ind;
    for (long long j = 0; j < cir.size(); j++) {
      if (cir[j] == lead) {
        ind = j;
        break;
      }
    }
    int temp = v[i] + ind;
    int siz = cir.size();
    temp %= siz;
    lead = cir[(temp + 1) % siz];
    cout << cir[temp] << " ";
    cir.erase(cir.begin() + temp);
  }
}
