#include <bits/stdc++.h>
using namespace std;
int n, m;
vector<int> ans;
vector<pair<int, int> > a;
bool solve() {
  int ind = 0;
  for (int i = 0; i < ((int)a.size()); ++i) {
    int num = a[i].first;
    num = min(num, n / 2);
    for (int j = 0; j < num; ++j) {
      if (ans[ind] == -1) {
        ans[ind] = a[i].second;
        ind += 2;
        if (ind >= n) {
          if (ind % 2 == 1)
            break;
          else
            ind = 1;
        }
      } else {
        break;
      }
    }
  }
  for (int i = 0; i < ((int)ans.size()); ++i) {
    if (ans[i] == -1) return false;
  }
  return true;
}
int main() {
  cin >> n >> m;
  for (int i = 0; i < m; ++i) {
    int first;
    cin >> first;
    a.push_back(make_pair(first, i));
  }
  sort((a).begin(), (a).end());
  reverse((a).begin(), (a).end());
  ans.assign(n, -1);
  if (solve()) {
    for (int i = 0; i < ((int)ans.size()); ++i) {
      cout << ans[i] + 1 << " ";
    }
    cout << endl;
  } else {
    cout << "-1" << endl;
  }
  return 0;
}
