import * as fs from 'fs';

// parameter "input" gets all data
function Main(input: string) {
    const lines = input.split('\n');
    const [n, m] = lines[0].split(' ').map(int => parseInt(int));
    const a = lines[1].split(' ').map(int => parseInt(int));

    let sum = 0;
    for (let i = 0; i < m; i++) {
        sum += a[i];
    }

    //output
    console.log(n - sum >= 0 ? n - sum : -1);
}

// Don't edit this line!
Main(fs.readFileSync('/dev/stdin', 'utf8'));
