import Control.Monad.ST
import Data.Char


readInt :: IO Int
readInt = read <$> getLine :: IO Int

readIntSplit :: IO [Int]
readIntSplit = map read . words <$> getLine :: IO [Int]

readStr :: IO String
readStr = getLine

readStrSplit :: IO [String]
readStrSplit = map read . words <$> getLine



solve :: [Int] -> Int
solve [] = 1
solve (x:xs)
  | x * solve xs > 10^18 = -1
  | otherwise = x * solve xs


main :: IO ()
main = do
  n <- readInt
  a <- readIntSplit
  print $ solve a