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