{-# LANGUAGE Strict #-}
import qualified Data.ByteString.Char8 as B
import           Data.List             (unfoldr)


main :: IO ()
main = do
  [n, m] <- readIntsLn
  as <- readIntsLn
  print $ solve n m as

solve :: Int -> Int -> [Int] -> Int
solve n _ as = max (-1) $ n - sum as

readIntsLn :: IO [Int]
readIntsLn = unfoldr (B.readInt . B.dropWhile (== ' ')) <$> B.getLine
