#include <bits/stdc++.h>
void debug() {}
int n, k;
int main() {
  scanf("%d %d", &n, &k);
  std::list<int> li;
  for (int i = 1; i <= n; ++i) {
    li.push_back(i);
  }
  int leader = 0;
  for (int i = 1; i <= k; ++i) {
    int x;
    scanf("%d", &x);
    int step = x % li.size();
    leader = (leader + step) % li.size();
    auto pos = li.begin();
    std::advance(pos, leader);
    printf("%d ", *pos);
    auto it = li.erase(pos);
    leader = std::distance(li.begin(), it);
  }
  return 0;
}
