#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
using namespace std;
template <typename T, typename TT>
inline ostream &operator<<(ostream &os, const pair<T, TT> &t) {
  return os << t.first << " " << t.second;
}
template <typename T>
inline ostream &operator<<(ostream &os, const vector<T> &t) {
  for (auto i : t) os << i << " ";
  return os;
}
template <typename T>
inline istream &operator>>(istream &is, vector<T> &v) {
  for (T &t : v) is >> t;
  return is;
}
template <typename T1, typename T2>
inline istream &operator>>(istream &is, pair<T1, T2> &t) {
  is >> t.first >> t.second;
  return is;
}
const long long mod = 1e9 + 7;
void solve() {
  int n, m;
  cin >> n >> m;
  vector<pair<long long, long long> > v(m);
  for (int i = 0; i < m; i++) {
    cin >> v[i].first;
    v[i].second = i + 1;
  }
  sort(v.begin(), v.end(), greater<pair<long long, long long> >());
  vector<int> ans(n, -1);
  int c = 0, j = 0;
  if (n & 1) {
    for (int i = 0; i < 2 * n; i += 2) {
      if (j == m) {
        cout << -1 << '\n';
        return;
      }
      ans[i % n] = v[j].second;
      v[j].first--;
      c++;
      if (!v[j].first or c == n / 2) c = 0, j++;
    }
    cout << ans << '\n';
    return;
  }
  for (int i = 0; i < n; i += 2) {
    if (j == m) {
      cout << -1 << '\n';
      return;
    }
    ans[i] = v[j].second;
    v[j].first--;
    c++;
    if (!v[j].first or c == n / 2) c = 0, j++;
  }
  for (int i = 1; i < n; i += 2) {
    if (j == m) {
      cout << -1 << '\n';
      return;
    }
    ans[i] = v[j].second;
    v[j].first--;
    c++;
    if (!v[j].first or c == n / 2) c = 0, j++;
  }
  cout << ans << '\n';
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  ;
  int T = 1;
  while (T--) {
    solve();
  }
  return 0;
}
