function Main(input){
    input = input.split("\n");
    var total = parseInt(input[0].split(" ")[0],10);
    var shukudai = 0;
    //console.log(input[1].split(" "));
    input[1].split(" ").forEach(element => {
        //console.log(element);
        shukudai += parseInt(element, 10);
    });
    var ans = total - shukudai;
    if(ans < 0){
        ans = -1;
    }
    
    //console.log(total);
    //console.log(shukudai);
    console.log(ans);
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));