module Main where

import Data.List

main :: IO ()
main = do
  _ <- getLine
  as <- sort . map read . words <$> getLine :: IO [Int]
  case head as of
    0 -> print 0
    _ -> proAndPrint (reverse 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)
  
