#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:1024000000,1024000000")
using namespace std;
template <class T>
inline bool read(T &n) {
  T x = 0, tmp = 1;
  char c = getchar();
  while ((c < '0' || c > '9') && c != '-' && c != EOF) c = getchar();
  if (c == EOF) return false;
  if (c == '-') c = getchar(), tmp = -1;
  while (c >= '0' && c <= '9') x *= 10, x += (c - '0'), c = getchar();
  n = x * tmp;
  return true;
}
template <class T>
inline void write(T n) {
  if (n < 0) {
    putchar('-');
    n = -n;
  }
  int len = 0, data[20];
  while (n) {
    data[len++] = n % 10;
    n /= 10;
  }
  if (!len) data[len++] = 0;
  while (len--) putchar(data[len] + 48);
}
const int MAXN = 1010;
int n, m;
pair<int, int> v[MAXN];
int ans[MAXN];
bool cmp(pair<int, int> a, pair<int, int> b) { return a.first >= b.first; }
int main() {
  int sum = 0;
  read(n), read(m);
  for (int i = 0; i < m; i++) {
    read(v[i].first);
    v[i].second = i + 1;
    v[i].first = min(v[i].first, n / 2);
    sum += v[i].first;
  }
  if (n > sum) {
    puts("-1");
    return 0;
  }
  sort(v, v + m, cmp);
  int nn = n, pos = 0, ii = 0;
  while (nn) {
    while (v[ii].first && nn) {
      v[ii].first--;
      nn--;
      ans[pos] = v[ii].second;
      pos += 2;
      if (pos > n - 1) pos = 1;
    }
    ii++;
  }
  for (int i = 0; i < n; i++) write(ans[i]), putchar(' ');
  putchar('\n');
  return 0;
}
