#include <bits/stdc++.h>
using namespace std;
struct T {
  int x, y;
} p[1005];
int f(T a, T b) { return a.x != b.x ? a.x > b.x : a.y < b.y; }
int main() {
  int i, j, k, n, m, d[1005], l, v;
  while (scanf("%d%d", &n, &m) != EOF) {
    memset(d, 0, sizeof(d));
    for (i = 0; i < m; i++) scanf("%d", &p[i].x), p[i].y = i + 1;
    sort(p, p + m, f);
    k = l = 0;
    for (i = 0; i < m; i++) {
      v = k;
      for (j = l; j < n; j += 2) {
        if (p[i].x && (p[i].y != d[j + 1] && j && p[i].y != d[j - 1]) ||
            (j == 0 && p[i].y != d[j + 1]))
          d[j] = p[i].y, p[i].x--, k++;
        else
          break;
        if (k == n) break;
      }
      if (v == k) p[i].x = 0;
      if (j == n) {
        l = 1;
        if (p[i].x) i--;
      }
      if (j > n) {
        if (d[0] == d[n - 1]) {
          d[n - 1] = p[i + 1].y;
          p[i + 1].x--;
        }
        l = 1;
        if (p[i].x) i--;
      }
      if (j < n) l = j;
      if (k == n) break;
    }
    if (k != n)
      printf("-1\n");
    else {
      for (i = 0; i < n - 1; i++) printf("%d ", d[i]);
      printf("%d\n", d[n - 1]);
    }
  }
  return 0;
}
