#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  vector<int> a(m);
  int flag = 0, index = n, sum = 0;
  for (int j = 0; j < m; j++) {
    cin >> a[j];
    sum += a[j];
    if (flag < a[j]) {
      flag = a[j];
      index = j;
    }
  }
  if (sum - flag < (n + 1) / 2 || sum < n || (n % 2 == 1 && m == 2)) {
    cout << -1 << endl;
    return 0;
  }
  vector<int> ans1((n + 1) / 2), ans2(n - (n + 1) / 2);
  int i = 0;
  for (i = 0; i < min(n / 2, flag); i++) ans1[i] = index + 1;
  for (int j = 0; j < m; j++) {
    while (j != index && i < ans1.size() && a[j] > 0) {
      a[j]--;
      ans1[i++] = j + 1;
    }
  }
  i = ans2.size() - 1;
  for (int j = m - 1; j >= 0; j--) {
    while (j != index && i >= 0 && a[j] > 0) {
      a[j]--;
      ans2[i--] = j + 1;
    }
  }
  for (int j = 0; j < ans1.size(); j++) {
    if (j < ans2.size())
      cout << ans1[j] << ' ' << ans2[j] << ' ';
    else
      cout << ans1[j] << ' ';
  }
}
