let s = readLine()!.split(separator: " ")
let N = Int(s[0])
let M = Int(s[1])

let t = readLine()!.split(separator: " ").map({Int($0)!})

let work = t.reduce(0, {x,y in x+y})

if N! >= work {
    print(N! - work)
} else {
    print(-1)
}