import Data.Maybe

solve :: [Int] -> Maybe Int
solve aList
 |product(aList)>10^9=Nothing
 |otherwise=Just $product aList

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