import Data.Maybe

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

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