import Data.Maybe

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

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