inp = require('fs').readFileSync('/dev/stdin', 'utf8').trim().split('\n')
l = inp.shift().split(' ')
N = l.shift() * 1
M = l.shift() * 1 
l = inp.shift().split(' ').map(x => +x)
j = 0
for (i=0; i<M; i++) {
  j += l[i]
}
console.log(Math.max(-1, N - j))