import Data.List

main = do
    getLine
    as <- map read . words <$> getLine :: IO [Integer]
    let z = 0 `elem` as
    print $ if z then 0 else f 1 as

f s [] = s
f s (a:as) | s*a >10^18 = -1
           | otherwise = f (s*a) as 