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