#include <bits/stdc++.h>
size_t n, k, left;
std::vector<bool> kids;
size_t next(size_t current) {
  current = (current % kids.size());
  do {
    current = (current + 1) % kids.size();
  } while (!kids[current]);
  return current;
}
int main() {
  std::cin >> n >> k;
  left = n;
  kids.resize(n, true);
  std::vector<int> a;
  for (int i = 0; i < k; i++) {
    int temp;
    scanf("%d", &temp);
    a.push_back(temp);
  }
  size_t current = 0;
  for (int i = 0; i < k; ++i) {
    size_t leave = current;
    size_t times = a[i] % left;
    for (int j = 0; j < times; ++j) {
      leave = next(leave);
    }
    kids[leave] = false;
    --left;
    current = next(leave);
    printf("%d ", leave + 1);
  }
  return 0;
}
