#include <bits/stdc++.h>
using namespace std;
void eliminate(long long);
deque<long long> circle;
deque<long long> elimi;
int main() {
  long long n, k;
  cin >> n >> k;
  for (int i = 0; i < n; i++) {
    circle.push_back(i + 1);
  }
  long long cir_size = circle.size();
  for (int i = 0; i < k; i++) {
    long long temp;
    cin >> temp;
    elimi.push_back(temp);
  }
  for (int i = 0; i < k; i++) {
    eliminate(elimi[i] % circle.size());
  }
  return 0;
}
void eliminate(long long num) {
  for (int i = 0; i < num; i++) {
    circle.push_back(circle[0]);
    circle.pop_front();
  }
  cout << circle[0] << ' ';
  circle.pop_front();
  return;
}
