#include <bits/stdc++.h>
using namespace std;
int main() {
  int i, n, m;
  cin >> n;
  cin >> m;
  vector<int> a(m);
  for (int i = 0; i < m; i++) {
    cin >> a[i];
    int sum = 0;
    sum += a[i];
    if (sum > n) {
      cout << -1;
      return 0;
    } else
      cout << n - sum;
  }
}
