let n, m = stdin.ReadLine().Split() |> fun [| a; b |] -> int a, int b 
let a = stdin.ReadLine().Split() |> Array.map int

n - ( a |> Array.sum)
|> function 
| x when x < 0 -> -1
| x -> x
|> stdout.WriteLine
