#include <bits/stdc++.h>
using namespace std;
template <class T>
void chmin(T &a, const T &b) {
  if (a > b) a = b;
}
template <class T>
void chmax(T &a, const T &b) {
  if (a < b) a = b;
}
template <class T>
using MaxHeap = priority_queue<T>;
template <class T>
using MinHeap = priority_queue<T, vector<T>, greater<T>>;
template <class T>
vector<T> vect(int len, T elem) {
  return vector<T>(len, elem);
}
template <class T, class U>
ostream &operator<<(ostream &os, const pair<T, U> &p) {
  os << p.first << ',' << p.second;
  return os;
}
template <class T, class U>
istream &operator>>(istream &is, pair<T, U> &p) {
  is >> p.first >> p.second;
  return is;
}
template <class T>
ostream &operator<<(ostream &os, const vector<T> &vec) {
  for (int i = 0; i < vec.size(); i++) {
    os << vec[i];
    if (i + 1 < vec.size()) os << ' ';
  }
  return os;
}
template <class T>
istream &operator>>(istream &is, vector<T> &vec) {
  for (int i = 0; i < vec.size(); i++) is >> vec[i];
  return is;
}
void fastio() {
  cin.tie(0);
  ios::sync_with_stdio(0);
  cout << fixed << setprecision(20);
}
template <class T>
struct RangeSum {
  vector<T> vec;
  RangeSum() {}
  RangeSum(vector<T> elems) : vec(elems) {
    for (int i = 1; i < vec.size(); i++) {
      vec[i] += vec[i - 1];
    }
  }
  T sum(int l, int r) {
    if (l > r) return T(0);
    if (l == 0)
      return vec[r];
    else
      return vec[r] - vec[l - 1];
  }
};
void solve() {
  int n, m;
  cin >> n >> m;
  vector<long long> l(m);
  cin >> l;
  RangeSum<long long> rs(l);
  vector<int> ans(m);
  long long uncol = n - 1;
  set<int> s;
  for (int i = m - 1, j = n; i >= 0; i--, j--) {
    long long L = i, R = n - l[i];
    chmin(R, rs.sum(0, i - 1));
    chmax(L, uncol - l[i] + 1);
    chmin(R, uncol);
    if (L > R) {
      cout << -1 << "\n";
      return;
    }
    uncol = R - 1;
    ans[i] = R;
  }
  for (int i = 0; i < ans.size(); i++) {
    cout << ans[i] + 1;
    if (i + 1 < ans.size())
      cout << ' ';
    else
      cout << "\n";
  }
  return;
}
signed main() {
  fastio();
  solve();
  return 0;
}
