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