function Main(input) {
  var lines = input.split('\n');
  var line_1 = lines[0].split(' ');
  var N = Number(line_1[0]);
  var M = Number(line_1[1]);
  var A = lines[1].split(' ');
  var holiday = N;
  for (var i = 0; i < M; i ++) {
    holiday = holiday - Number(A[i]);
  }

  if (0 <= holiday) {
    console.log(holiday);
  } else {
    console.log(-1);
  }
}

Main(require("fs").readFileSync("/dev/stdin", "utf8"));
