#include <bits/stdc++.h>
using namespace std;
const int INF = 2147483647;
const double PI = 3.141592653589793;
int n, m, tab[45], res[1005], sum, i, j, ind;
vector<int> wyb;
int main() {
  scanf("%d %d", &n, &m);
  for (i = 0; i < m; i++) {
    scanf("%d", &tab[i]);
    tab[i] = min(tab[i], n / 2);
    sum += tab[i];
  }
  if (sum < n) {
    printf("-1\n");
    return 0;
  }
  for (i = 0; i < n; i += 2) wyb.push_back(i);
  for (i = 1; i < n; i += 2) wyb.push_back(i);
  i = 0;
  while (i < wyb.size()) {
    ind = 0;
    for (j = 1; j < m; j++)
      if (tab[j] > tab[ind]) ind = j;
    while (i < wyb.size() && tab[ind] > 0) {
      res[wyb[i]] = ind;
      tab[ind]--;
      i++;
    }
  }
  for (i = 0; i < n; i++) printf("%d ", res[i] + 1);
  return 0;
}
