#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k;
  cin >> n >> k;
  vector<int> circle(n);
  std::iota(circle.begin(), circle.end(), 1);
  long long leader = 0;
  for (int i = 0; i < k; ++i) {
    long long myk;
    cin >> myk;
    long long todel = (leader + myk) % n;
    cout << circle[todel] << " ";
    leader = circle.erase(circle.begin() + todel) - circle.begin();
    n--;
  }
  return 0;
}
