#include <bits/stdc++.h>
using namespace std;
int main() {
  int m, n;
  scanf("%d %d", &m, &n);
  vector<pair<int, int> > mas(n);
  int sum = 0;
  for (int i = 0; i < n; i++) {
    scanf("%d", &mas[i]);
    mas[i].first = min(mas[i].first, m / 2);
    sum += mas[i].first;
    mas[i].second = i + 1;
  }
  if (sum < m) {
    printf("-1");
    return 0;
  }
  sort(mas.rbegin(), mas.rend());
  int cnt = 0;
  vector<int> res(m);
  int ind = 0;
  for (int i = 0; i < m; i += 2) {
    while (mas[ind].first == 0) ind++;
    res[i] = mas[ind].second;
    mas[ind].first--;
  }
  for (int i = 1; i < m; i += 2) {
    while (mas[ind].first == 0) ind++;
    res[i] = mas[ind].second;
    mas[ind].first--;
  }
  for (int i = 0; i < m; i++) printf("%d ", res[i]);
  return 0;
}
