"use strict";

const main = arg => {

  const input = arg.trim().split("\n");

  const N = parseInt(input[0].split(" ")[0]);
  const M = parseInt(input[0].split(" ")[1]);
  const A = input[1].split(" ").map(n=>parseInt(n));
  let result = N;
  A.forEach(elm => {
    result -= elm
  })
  if(result < 0) {
  	console.log(-1)
  } else {
  	console.log(result)
  }

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