#include <bits/stdc++.h>
using namespace std;
int n, m, n1, n2, n3;
pair<int, int> a[1001];
int ans[1001];
int main() {
  cin >> n >> m;
  for (int i = 0; i < m; ++i) {
    cin >> a[i].first;
    a[i].second = i + 1;
  }
  sort(a, a + m, greater<pair<int, int> >());
  if (n % 2 == 1) {
    n1 = n / 2 + 1, n2 = n / 2, n3 = 1;
  } else {
    n1 = n / 2, n2 = n / 2, n3 = 0;
  }
  int kol = a[0].first;
  int uk = 1;
  for (int i = 0; i < n; i += 2) {
    for (int j = 0; j < m; ++j) {
      if (a[j].first > 0 && ans[(i - 1 + n) % n] != a[j].second &&
          ans[(i + 1) % n] != a[j].second) {
        ans[i] = a[j].second;
        a[j].first--;
        n1--;
        break;
      }
    }
  }
  for (int i = 1; i < n; i += 2) {
    for (int j = 0; j < m; ++j) {
      if (a[j].first > 0 && ans[(i - 1 + n) % n] != a[j].second &&
          ans[(i + 1) % n] != a[j].second) {
        ans[i] = a[j].second;
        a[j].first--;
        n2--;
        break;
      }
    }
  }
  if (n1 + n2 == 0) {
    for (int i = 0; i < n; ++i) {
      cout << ans[i] << ' ';
    }
  } else {
    cout << -1;
  }
  return 0;
}
