#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, M;
  cin >> N >> M;
  vector<int> A(M);
  int sum = N;
  for (int i = 0; i < M; ++i) {
    cin >> A.at(i);
    sum = sum - A.at(i);
  }
  if (sum < 0) {
    cout << "-1" << endl;
  } else {
    cout << sum << endl;
  }
  return 0;
}
