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