#include <bits/stdc++.h>
using namespace std;
int n, k, s = 0;
deque<int> d;
int main() {
  ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  ;
  cin >> n >> k;
  int arr[n + 5];
  for (int i = 0; i < n; i++) d.push_back(i);
  for (int i = 0; i < k; i++) cin >> arr[i];
  for (int i = 0; i < k; i++) {
    int e = (arr[i] + s) % d.size();
    cout << d[e] + 1 << " ";
    d.erase(d.begin() + (e));
    s = e;
  }
  return 0;
}
