import Data.Maybe

solve :: [Integer] -> Integer
solve aList
 | (maximum aList) > 10^18 = -1
 | (product aList) > 10^18 = -1 
 | otherwise = (product aList)

main = do
  _ <- getLine
  aList <- map read . words <$> getLine :: IO [Integer]
  let ans = solve aList
  print ans