#include <bits/stdc++.h>
using namespace std;
int m, n, re[1111];
vector<pair<int, int> > a;
int main() {
  int i, j, x, y;
  cin >> n >> m;
  for (i = 1; i <= m; i++) cin >> x, a.push_back(make_pair(x, i));
  sort(a.begin(), a.end());
  i = 0;
  y = n;
  x = m - 1;
  while (y) {
    while ((!a[x].first || re[(i + 1) % n] == a[x].second ||
            re[(i + n - 1) % n] == a[x].second) &&
           x >= 0)
      x--;
    if (x < 0) break;
    re[i] = a[x].second;
    a[x].first--;
    i += 2;
    y--;
    if (i >= n) i = 1;
  }
  if (y)
    cout << -1;
  else
    for (i = 0; i <= n - 1; i++) cout << re[i] << " ";
  cout << endl;
  return 0;
}
