go :: [Integer] -> Integer
go = go' (Just 1) where
    go' Nothing [] = -1
    go' Nothing (0:as) = 0
    go' Nothing (a:as) = if a == 0 then 0 else go' Nothing as
    go' (Just acc) [] = acc
    go' (Just acc) (0:as) = 0
    go' (Just acc) (a:as) =
        let b = acc * a in if b <= 10^18 then go' (Just b) as else go' Nothing as

main = do
    n <- readLn :: IO Integer
    as <- map read . words <$> getLine :: IO [Integer]
    print $ go as
