#include <bits/stdc++.h>
using namespace std;
struct mydata {
  int id;
  int x;
  int num;
  bool operator<(const mydata &r) const {
    if (x == r.x)
      return id < r.id;
    else
      return x < r.x;
  }
} data[50];
int ret[2000];
int main() {
  int n, m;
  scanf("%d%d", &n, &m);
  int i;
  for (i = 0; i < m; i++) {
    data[i].id = i + 1;
    data[i].num = 0;
    scanf("%d", &data[i].x);
  }
  sort(data, data + m);
  int total = n;
  int maxnum = 0;
  for (i = 0; i < m; i++) {
    data[i].num = min(data[i].x, total / (m - i));
    maxnum = max(maxnum, data[i].num);
    total -= data[i].num;
  }
  if (total > 0)
    printf("-1\n");
  else if (maxnum * 2 > n)
    printf("-1\n");
  else {
    int idx = 0;
    int j;
    for (i = 0; i < m; i++) {
      for (j = 0; j < data[i].num; j++) {
        ret[idx] = data[i].id;
        idx += 2;
        if (idx >= n) idx = 1;
      }
    }
    for (i = 0; i < n; i++) printf("%d ", ret[i]);
    printf("\n");
  }
  return 0;
}
