#include <bits/stdc++.h>
using namespace std;
int a[500010];
int main() {
  int n, k;
  scanf("%d %d", &n, &k);
  for (int i = 0; i < n; i++) {
    a[i] = i;
  }
  int tmp;
  int leader = 0;
  int size = n;
  for (int i = 0; i < k; i++) {
    if (i) printf(" ");
    scanf("%d", &tmp);
    leader = (leader + tmp) % size;
    printf("%d", a[leader] + 1);
    for (int j = leader + 1; j < size; j++) {
      a[j - 1] = a[j];
    }
    size--;
    if (size == leader) leader = 0;
  }
  return 0;
}
