function Main(input) {
  // 文字列をsplitして配列に格納
  input = input.split("\n");
  tmp1 = input[0].split(" ");
  tmp2 = input[1].split(" ");

  let n = parseInt(tmp1[0], 10);
  let m = parseInt(tmp1[1], 10);
  let kadai = tmp2.map(e => parseInt(e));
  let total = kadai.reduce(function(a, x){ return a + x;});
  let days_left = n - total;

  if (days_left >= 0){
    console.log(days_left);
  } else {
    console.log(-1);
  }

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