import Control.Monad
import qualified Data.ByteString.Char8 as B
import Data.Char (isSpace)
import qualified Data.Vector as V

m :: Integer
m = 10 ^ 18

pr :: Integer -> Integer -> Maybe Integer
pr a b = let x = a * b in if x > m then Nothing else Just x

main :: IO ()
main = do
  _ <- getLine
  xs <- V.unfoldr (B.readInteger . B.dropWhile isSpace) <$> B.getLine
  print $
    if elem 0 xs
      then 0
      else maybe (-1) id $ foldM pr 1 xs