"use strict"
function main(arg) {
    var N = arg.trim().split("\n")[0].split(" ").map(Number)[0]
    var Ai = arg.trim().split("\n")[1].split(" ").map(Number)
    var ans = N - sum(Ai)
    if (ans < 0) {
        ans = -1
    }
    console.log(ans)
}

function sum(arr) {
    return arr.reduce(function(prev, current, i, arr) {
        return prev+current;
    });
};
main(require('fs').readFileSync('/dev/stdin', 'utf8'));