'use strict';
function main(input) {
  input = input.split(" ");
  const a = parseInt(input[0], 10);
  const b = parseInt(input[1], 10);
  let sum;

  for (let i = 2; i < input.length; i ++) {
    sum += input[i];
  }

  if (sum <= a) {
    console.log(a - sum);
  } else {
    console.log(-1);
  }
  
}

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