#include <bits/stdc++.h>
using namespace std;
const int maxN = 50;
const int maxL = 1000 + 5;
int n, m, sum;
int res[maxL];
pair<int, int> a[maxN];
int main() {
  cin >> n >> m;
  for (int i = 1; i <= m; i++) {
    int tmp;
    cin >> tmp;
    a[i] = pair<int, int>(min(n / 2, tmp), i);
    sum += a[i].first;
  }
  if (sum < n) {
    cout << -1 << endl;
    return 0;
  }
  sort(a + 1, a + m + 1);
  reverse(a + 1, a + m + 1);
  int poi = 1;
  for (int i = 0; i < n; i += 2) {
    while (a[poi].first == 0) poi++;
    res[i] = a[poi].second;
    a[poi].first--;
  }
  for (int i = 1; i < n; i += 2) {
    while (a[poi].first == 0) poi++;
    res[i] = a[poi].second;
    a[poi].first--;
  }
  for (int i = 0; i < n; i++) cout << res[i] << ' ';
  cout << endl;
  return 0;
}
