import Data.Foldable

go :: [Integer] -> Integer
go = foldl' (\a b -> let ab = a * b in if ab > 10^18 then -1 else ab) 1

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