#include <bits/stdc++.h>
using namespace std;
void init() {}
int tonum_int(const string& str) {
  int num;
  stringstream ss(str);
  ss >> num;
  return num;
}
int a[50];
int res[2000];
vector<pair<int, int> > vvc;
int main() {
  init();
  int n, m;
  cin >> n >> m;
  int ava = 0;
  for (int i = 0; i < m; ++i) {
    cin >> a[i];
    a[i] = min(a[i], n / 2);
    ava += a[i];
    vvc.push_back(make_pair(a[i], i));
  }
  if (ava < n) {
    cout << "-1" << endl;
    return 0;
  }
  sort(vvc.begin(), vvc.end());
  reverse(vvc.begin(), vvc.end());
  vector<int> pos;
  for (int i = 0; i < n; i += 2) {
    pos.push_back(i);
  }
  for (int i = 1; i < n; i += 2) {
    pos.push_back(i);
  }
  int ind = 0;
  for (int i = 0; i < n; ++i) {
    res[pos[i]] = vvc[ind].second;
    vvc[ind].first--;
    if (vvc[ind].first == 0) {
      ++ind;
    }
  }
  for (int i = 0; i < n; ++i) {
    if (i != 0) cout << " ";
    cout << res[i] + 1;
  }
  cout << endl;
  return 0;
}
