{-# OPTIONS_GHC -O2 #-}

import qualified Data.Maybe as Maybe
import qualified Data.ByteString.Char8 as BSC8

readIntegers :: IO [Integer]
readIntegers = map ( fst . Maybe.fromJust . BSC8.readInteger ) . BSC8.words <$> BSC8.getLine

main :: IO ()
main = do
  BSC8.getLine
  x <- product <$> readIntegers
  if x > 10^18
    then print (-1)
    else print x