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