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