#include <bits/stdc++.h>
using namespace std;
const int N = 1e2 + 5;
const long long mod = 1e9 + 7;
long long powermodm(long long x, long long n, long long M) {
  long long result = 1;
  while (n > 0) {
    if (n % 2 == 1) result = (result * x) % M;
    x = (x * x) % M;
    n = n / 2;
  }
  return result;
}
long long power(long long x, long long y) {
  long long z = 1;
  while (y) {
    if (y % 2 == 1) z = (z * x);
    y /= 2;
    x = (x * x);
  }
  return z;
}
long long gcd(long long a, long long b) {
  if (a == 0) return b;
  return gcd(b % a, a);
}
long long lcm(long long a, long long b) {
  return (max(a, b) / gcd(a, b)) * min(a, b);
}
int main() {
  long long i, n, m;
  cin >> n >> m;
  long long a[m], ans[m];
  vector<pair<long long, long long> > v;
  for (i = 0; i < m; i++) {
    cin >> a[i];
    v.push_back(make_pair(a[i], i));
  }
  long long en;
  for (i = 0; i < m; i++) {
    if (i + v[i].first > n) {
      cout << -1;
      return 0;
    }
    ans[v[i].second] = i + 1;
    en = i + v[i].first;
  }
  if (en == n) {
    for (i = 0; i < m; i++) cout << ans[i] << " ";
    return 0;
  }
  long long tar = n;
  i = m - 1;
  while (true) {
    ans[v[i].second] = tar - v[i].first + 1;
    tar -= v[i].first;
    i--;
    if (i == -1 || i + 1 + v[i].first >= ans[v[i + 1].second]) break;
  }
  if (ans[v[0].second] != 1) {
    cout << -1;
    return 0;
  }
  for (i = 0; i < m; i++) cout << ans[i] << " ";
  return 0;
}
