var input = require('fs').readFileSync('/dev/stdin', 'utf8').split('\n')
var N = parseInt(input[0].split(' ')[0])
var sum = input[1].split(' ').map(Number).reduce((a, b) => a + b)
console.log((sum <= N)? N - sum : -1)