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

main :: IO ()
main = do
  n <- readInt
  a <- readIntSplit
  print $ if solve a < 10^18 then solve a else -1