toInt x = read x :: Int

main = do
    nm <- map toInt . words <$> getLine
    ai <- map toInt . words <$> getLine
    let vacation = (head nm) - (sum ai)
    if vacation <= 0 then print (-1)
                     else print vacation