#include <bits/stdc++.h>
using namespace std;
int compareup(const void *a, const void *b) { return (*(int *)a > *(int *)b); }
int comparedown(const void *a, const void *b) {
  return (*(int *)a < *(int *)b);
}
void printArr(const vector<string> &a) {
  for (int i = 0; i < a.size(); i++) cout << a[i] << endl;
  cout << endl;
}
void printArr(const vector<int> &a) {
  for (int o = 0; o < a.size(); o++) cout << a[o] << ' ';
  cout << endl << endl;
}
void printArr(const vector<double> &a) {
  for (int o = 0; o < a.size(); o++) cout << a[o] << ' ';
  cout << endl << endl;
}
void printArr(const vector<vector<int> > &a) {
  for (int i = 0; i < a.size(); i++) {
    for (int o = 0; o < a[i].size(); o++) cout << a[i][o] << ' ';
    cout << endl;
  }
  cout << endl;
}
void printArr(const vector<vector<string> > &a) {
  for (int i = 0; i < a.size(); i++) {
    for (int o = 0; o < a[i].size(); o++) cout << a[i][o];
    cout << endl;
  }
  cout << endl;
}
void printArr(const vector<char> &a) {
  for (int i = 0; i < a.size(); i++) cout << a[i] << ' ';
  cout << endl;
}
void printArr(const vector<vector<bool> > &a) {
  for (int i = 0; i < a.size(); i++) {
    for (int o = 0; o < a[i].size(); o++) cout << a[i][o] << ' ';
    cout << endl;
  }
  cout << endl;
}
void printArr(const vector<vector<char> > &a) {
  for (int i = 0; i < a.size(); i++) {
    for (int o = 0; o < a[i].size(); o++) cout << a[i][o] << ' ';
    cout << endl;
  }
  cout << endl;
}
void printArr(const vector<long long int> &a) {
  for (int o = 0; o < a.size(); o++) cout << a[o] << ' ';
  cout << endl << endl;
}
void printArr(const vector<bool> &a) {
  for (int i = 0; i < a.size(); i++) cout << a[i] << ' ';
  cout << endl << endl;
}
void printArr(const int a[], const int &i) {
  for (int o = 0; o < i; o++) cout << a[o] << ' ';
  cout << endl << endl;
}
void printArr(const vector<pair<int, int> > &a) {
  cout << "###vec_pair###" << endl;
  for (int i = 0; i < a.size(); i++)
    cout << i << ' ' << a[i].first << ' ' << a[i].second << endl;
  cout << "###vec_pair###" << endl << endl;
}
void printArr(const vector<pair<string, string> > &a) {
  cout << "###vec_pair###" << endl;
  for (int i = 0; i < a.size(); i++)
    cout << i << ' ' << a[i].first << ' ' << a[i].second << endl;
  cout << "###vec_pair###" << endl << endl;
}
void printArr(const vector<pair<int, string> > &a) {
  cout << "###vec_pair###" << endl;
  for (int i = 0; i < a.size(); i++)
    cout << i << ' ' << a[i].first << ' ' << a[i].second << endl;
  cout << "###vec_pair###" << endl << endl;
}
int pcti(const char c) {
  stringstream ss;
  ss << c;
  int ans;
  ss >> ans;
  ss.str("");
  ss.clear();
  return ans;
}
int psti(const string c) {
  stringstream ss;
  ss << c;
  int ans;
  ss >> ans;
  ss.str("");
  ss.clear();
  return ans;
}
string pits(const int c) {
  stringstream ss;
  ss << c;
  string ans;
  ss >> ans;
  ss.str("");
  ss.clear();
  return ans;
}
char pitc(const int i) {
  stringstream ss;
  ss << i;
  char ans;
  ss >> ans;
  ss.str("");
  ss.clear();
  return ans;
}
bool obr(const int &a, const int &b) { return a > b; }
int nod(int a, int b) {
  if (b == 0)
    return a;
  else
    return nod(b, a % b);
}
int main() {
  int TEST = 0;
  ifstream FPROVMAKHOME("mak.home");
  if (FPROVMAKHOME.is_open()) TEST = 1;
  FPROVMAKHOME.close();
  int timeBeg;
  ios::sync_with_stdio(false);
  if (TEST) {
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    timeBeg = clock();
  }
  int n, k;
  cin >> n >> k;
  vector<int> v(k), p(n);
  for (long long int i = 0; i < k; i++) cin >> v[i];
  for (long long int i = 0; i < n; i++) p[i] = i + 1;
  int m = 0;
  for (long long int i = 0; i < k; i++) {
    m = (m + v[i]) % p.size();
    cout << p[m] << ' ';
    p.erase(p.begin() + m);
  }
  if (TEST) {
    int timeEnd = clock();
    cout << endl
         << fixed << setprecision(3) << double(timeEnd - timeBeg) / 1000
         << endl;
    fclose(stdout);
    fclose(stdin);
  }
  return 0;
}
