module Main where

main :: IO ()
main = do
  _ <- getLine
  as <- map read . words <$> getLine :: IO [Int]
  proAndPrint as 1

limit :: Int
limit = 10^18

proAndPrint :: [Int] -> Int -> IO ()
proAndPrint [] n = print n
proAndPrint (x:xs) n = do
  case n * x > limit of
    True -> print (-1)
    False -> proAndPrint xs (n * x)
  
