#include <bits/stdc++.h>
#pragma comment(linker, "/stack:67108864")
using namespace std;
const long double EPS = 1e-9;
const long double PI = 3.1415926535897932384626433832795;
const long long INF = 1e15;
int main() {
  ifstream ifile("input.txt");
  if (ifile) {
    freopen("input.txt", "rt", stdin);
  }
  if (ifile) freopen("output.txt", "wt", stdout);
  int n, m;
  while (cin >> n >> m) {
    vector<pair<int, int> > a(m);
    int sum = 0;
    for (int i = 0; i < int(m); ++i) {
      cin >> a[i].first;
      a[i].second = i + 1;
      sum += a[i].first;
    }
    if (sum < n) {
      cout << -1 << endl;
      continue;
    }
    if (n % 2 && m == 2) {
      cout << -1 << endl;
      continue;
    }
    sort((a).begin(), (a).end());
    if (sum - a.back().first < (n + 1) / 2) {
      cout << -1 << endl;
      continue;
    }
    vector<int> ans(n, 0);
    int j = m - 1;
    for (int i = 0; i < n; i += 2) {
      if (a[j].first == 0) {
        j--;
      }
      ans[i] = a[j].second;
      a[j].first--;
    }
    if (j == m - 1) {
      j--;
      if (n % 2) {
        ans[0] = a[0].second;
        a[0].first--;
      }
    }
    for (int i = 1; i < n; i += 2) {
      if (a[j].first == 0) {
        j--;
      }
      ans[i] = a[j].second;
      a[j].first--;
    }
    for (int i = 0; i < int(n); ++i) cout << ans[i] << ' ';
    cout << endl;
  }
  return 0;
}
