#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
using namespace std;
const long long mod = 1000000007;
const double PI = acos(-1);
void solve() {
  int n, m;
  cin >> n >> m;
  pair<int, int> l[m];
  long long sum = 0;
  for (int i = 0; i < m; i++) {
    cin >> l[i].first;
    l[i].second = i;
    sum += l[i].first;
  }
  int p[m], start = 0, covered = -1;
  for (int i = 0; i < m; i++) {
    if (sum < n) start = max(n - (int)sum, start);
    if (start > covered + 1) {
      cout << "-1\n";
      return;
    }
    if (start + l[i].first > n) {
      cout << "-1\n";
      return;
    }
    p[l[i].second] = start;
    covered = max(covered, start + l[i].first - 1);
    start++;
    sum -= l[i].first;
  }
  if (covered < n - 1) {
    cout << "-1\n";
    return;
  }
  for (int i = 0; i < m; i++) cout << p[i] + 1 << " ";
  cout << "\n";
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int t = 1;
  while (t--) solve();
}
