let input f = stdin.ReadLine() |> f
let inputs f = stdin.ReadLine().Split() |> Array.map f

let [|N; M|] = inputs int
let ans = N - Array.sum (inputs int)
if ans >= 0 then
    printfn "%d" ans
else
    printfn "-1"


