#include <bits/stdc++.h>
using namespace std;
struct album {
  int id, ct;
  album(int _id, int _ct) {
    id = _id;
    ct = _ct;
  }
  album() {}
  void read() { scanf("%d", &ct); }
};
album A[1005], aux[1005];
bool operator<(album a1, album a2) { return a2.ct < a1.ct; }
int res[1005];
int main() {
  int n, m;
  while (cin >> n >> m) {
    for (int i = 0; i < m; i++) A[i].read(), A[i].id = i + 1;
    sort(A, A + m);
    int cant = 0, pos = 0;
    for (int k = 0; k < m; k++) {
      while (res[pos] == 0 && A[k].ct > 0 && pos < n)
        res[pos] = A[k].id, A[k].ct--, pos += 2, cant++;
      if (k == 0 && pos == n + 1) pos = n - 1, cant--, res[pos] = 0;
      if (cant == n) break;
      if (pos >= n) pos = 1;
      if (k == 0) continue;
      while (res[pos] == 0 && res[pos - 1] != A[k].id &&
             res[pos + 1] != A[k].id && A[k].ct > 0 && pos < n)
        res[pos] = A[k].id, A[k].ct--, pos += 2, cant++;
      if (cant == n) break;
    }
    if (cant < n)
      puts("-1");
    else {
      printf("%d", res[0]);
      for (int i = 1; i < n; i++) printf(" %d", res[i]);
      puts("");
    }
  }
}
