#include <bits/stdc++.h>
using namespace std;
vector<long long> vec[(long long)1e6];
long long a[(long long)1e6];
void coding() {
  long long i, j, k, l, m, n, t;
  cin >> n >> m;
  vector<long long> v(n);
  for (i = 0; i < n; i++) {
    cin >> v[i];
    if (i + v[i] > n) {
      cout << "-1";
      return;
    }
  }
  for (i = m - 1; i >= 0; i--) a[i] = a[i + 1] + v[i];
  if (a[0] < n) {
    cout << "-1";
    return;
  }
  for (i = 0; i < m; i++) cout << max(i + 1, n - a[i] + 1) << " ";
}
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int t = 1;
  cout << fixed << setprecision(11);
  while (t--) {
    coding();
  }
}
