#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  vector<pair<int, int> > arr(m);
  vector<int> ans(n, -1);
  int sum = 0;
  for (int i = 0; i < m; i++) {
    cin >> arr[i].first;
    sum += arr[i].first;
    arr[i].second = i + 1;
  }
  if (sum < n) {
    cout << -1;
    return 0;
  }
  sort(arr.rbegin(), arr.rend());
  int now = 0;
  for (int i = 0; i < n; i += 2) {
    if (arr[now].first == 0) now++;
    if (now == m) {
      cout << -1;
      return 0;
    }
    while (now < m) {
      if (ans[(i - 1 + n) % n] != arr[now].second &&
          ans[(i + 1) % n] != arr[now].second) {
        arr[now].first--;
        ans[i] = arr[now].second;
        break;
      } else
        now++;
    }
    if (now == m) {
      cout << -1;
      return 0;
    }
  }
  for (int i = 1; i < n; i += 2) {
    if (arr[now].first == 0) now++;
    if (now == m) {
      cout << -1;
      return 0;
    }
    while (now < m) {
      if (ans[(i - 1 + n) % n] != arr[now].second &&
          ans[(i + 1) % n] != arr[now].second) {
        arr[now].first--;
        ans[i] = arr[now].second;
        break;
      } else
        now++;
    }
    if (now == m) {
      cout << -1;
      return 0;
    }
  }
  for (int i = 0; i < n; i++) cout << ans[i] << " ";
  return 0;
}
