#include <bits/stdc++.h>
using namespace std;
pair<int, int> a[44];
int b[1 << 10];
int main() {
  int n, m, pos = 0;
  scanf("%d %d", &n, &m);
  for (int i = 0; i < m; ++i) {
    scanf("%d", &a[i].first);
    a[i].first = min(a[i].first, n / 2);
    a[i].second = i + 1;
    pos += a[i].first;
  }
  if (pos < n) {
    printf("-1");
  } else {
    sort(a, a + m);
    vector<int> c;
    for (int i = 0; i < m; ++i) {
      while (a[i].first--) {
        c.push_back(a[i].second);
      }
    }
    for (int i = 1; i <= n; i += 2) {
      b[i] = c.back();
      c.pop_back();
    }
    for (int i = 2; i <= n; i += 2) {
      b[i] = c.back();
      c.pop_back();
    }
    for (int i = 1; i <= n; ++i) {
      printf("%d ", b[i]);
    }
  }
  return 0;
}
