#include <bits/stdc++.h>
using namespace std;
struct Node {
  int index;
  int num;
  bool operator<(Node o) const { return num > o.num; }
};
Node node[1005];
int out[1005];
int main() {
  int n, m;
  while (scanf("%d%d", &n, &m) != EOF) {
    for (int i = 0; i < m; i++) {
      scanf("%d", &node[i].num);
      node[i].index = i + 1;
    }
    sort(node, node + m);
    int cur = 0;
    memset(out, 0, sizeof(out));
    out[n + 1] = node[0].index;
    for (int k = 1; k <= 2; k++) {
      for (int i = k; i <= n; i += 2) {
        if (node[cur].num > 0 && node[cur].index != out[i - 1] &&
            node[cur].index != out[i + 1]) {
          node[cur].num--;
          out[i] = node[cur].index;
        } else {
          cur++;
          if (cur == m) {
            break;
          }
          node[cur].num--;
          out[i] = node[cur].index;
        }
      }
      if (cur == m) {
        break;
      }
    }
    if (cur == m) {
      puts("-1");
    } else {
      for (int i = 1; i <= n; i++) {
        if (i != 1) {
          putchar(' ');
        }
        printf("%d", out[i]);
      }
      puts("");
    }
  }
  return 0;
}
