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