let n, m = Scanf.scanf "%d %d\n" (fun n m -> n, m) in
let rec f i s =
  if i = m then s
  else
    let a = Scanf.scanf " %d" (fun a -> a) in
    f (i + 1) (s + a) in
let ans = max (n - f 0 0) ~-1 in
Printf.printf "%d\n" ans
