#include <bits/stdc++.h>
inline int getint() {
  int x = 0, p = 1;
  char c = getchar();
  while (c <= 32) c = getchar();
  if (c == 45) p = -p, c = getchar();
  while (c > 32) x = x * 10 + c - 48, c = getchar();
  return x * p;
}
using namespace std;
const int N = 1e5 + 5;
int n, m, res[N];
long long suf[N];
pair<int, int> a[N];
int main() {
  n = getint();
  m = getint();
  for (int(i) = 0; (i) < (m); (i)++) a[i] = make_pair(getint(), i);
  for (int i = m - 1; i >= 0; i--) suf[i] = suf[i + 1] + a[i].first;
  int now = -1, pre = -1;
  memset(res, -1, sizeof(res));
  for (int(i) = 0; (i) < (m); (i)++) {
    if (suf[i] < n - now - 1) return !printf("%d\n", -1);
    if (m - i > n - pre - 1) return !printf("%d\n", -1);
    long long x = max(1ll * n - now - 1 - suf[i + 1], 0ll);
    assert(x <= a[i].first);
    int p = max(1ll * pre + 1, 1ll * now + x - a[i].first + 1);
    if (!x) p = pre + 1;
    if (p + a[i].first - 1 >= n) return !printf("%d\n", -1);
    res[a[i].second] = p;
    pre = p;
    now = max(now, p + a[i].first - 1);
  }
  assert(res[m - 1] + a[m - 1].first - 1 < n);
  for (int(i) = 0; (i) < (m); (i)++) printf("%d ", res[i] + 1);
  return 0;
}
