main = do
  li <-getLine
  let [n,m] = map read $ words li
  li <- getLine
  let as = map read $ words li
  let ans = compute n m as
  print ans

compute :: Int -> Int -> [Int] -> Int
compute n m as = max (n - sum as) (-1)
