#include <bits/stdc++.h>
using namespace std;
int n, k;
vector<int> s;
int main() {
  scanf("%d%d", &n, &k);
  s.clear();
  for (int i = 1; i <= n; i++) s.push_back(i);
  int p = 0;
  for (int i = 1; i <= k; i++) {
    int x;
    scanf("%d", &x);
    p = (p + x) % s.size();
    cout << s[p] << endl;
    s.erase(s.begin() + p);
  }
}
