#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1005;
int n, m, A[MAXN], ans[MAXN];
int main() {
  while (scanf("%d %d", &n, &m) >= 1) {
    for (int i = (0); i < (int)(m); i++) {
      scanf("%d", &A[i]);
      A[i] = min(A[i], n / 2);
    }
    bool ok = false;
    int k = n;
    vector<pair<int, int>> V;
    for (int i = (0); i < (int)(m); i++) {
      int take = 0;
      if (k > A[i]) {
        take = A[i];
      } else {
        take = k;
      }
      k -= take;
      V.push_back({take, i});
      if (k == 0) {
        ok = true;
        break;
      }
    }
    if (!ok) {
      puts("-1");
      continue;
    }
    sort(V.begin(), V.end());
    reverse(V.begin(), V.end());
    int p = 0;
    for (int i = (0); i < (int)(((int)V.size())); i++) {
      int take = V[i].first;
      int who = V[i].second;
      while (take--) {
        ans[p] = who;
        p += 2;
        if (p >= n) p = 1;
      }
    }
    for (int i = (0); i < (int)(n); i++) {
      if (i) printf(" ");
      printf("%d", ans[i] + 1);
    }
    puts("");
  }
  return 0;
}
