#include <bits/stdc++.h>
using namespace std;
priority_queue<pair<int, pair<int, int> > > pq;
vector<int> ans;
int main() {
  int n, m, sum = 0;
  scanf("%d%d", &n, &m);
  while (pq.size()) pq.pop();
  for (int i = 1; i <= m; i++) {
    int x;
    scanf("%d", &x);
    pq.push(make_pair(x, make_pair(0, i)));
    sum += x;
  }
  if (sum < n) {
    printf("-1");
    return 0;
  }
  ans.clear();
  int lleft = -1, lnum = -1, fnum = -1;
  for (int i = 1; i <= n && pq.size(); i++) {
    if (i == n)
      while (pq.size() && pq.top().second.second == fnum) pq.pop();
    if (!pq.size()) break;
    int left = pq.top().first;
    int num = pq.top().second.second;
    pq.pop();
    ans.push_back(num);
    if (lleft == -1 && lnum == -1) fnum = num;
    if (lleft > 0) {
      if (lnum == fnum)
        pq.push(make_pair(lleft, make_pair(1, lnum)));
      else
        pq.push(make_pair(lleft, make_pair(0, lnum)));
    }
    lleft = left - 1;
    lnum = num;
  }
  if (ans.size() == n) {
    printf("%d", ans[0]);
    for (int i = 1; i < ans.size(); i++) printf(" %d", ans[i]);
  } else
    printf("-1");
  return 0;
}
