#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long n, k;
  cin >> n >> k;
  vector<long long> v;
  for (long long i = 1; i <= n; i++) {
    v.push_back(i);
  }
  for (long long i = 0; i < k; i++) {
    long long a;
    cin >> a;
    a %= v.size();
    for (long long j = 0; j < a; j++) {
      rotate(v.begin(), v.begin() + 1, v.end());
    }
    cout << v[0] << " ";
    v.erase(v.begin());
  }
  return 0;
}
