module Main where

ansOrNegative :: Integer -> Integer
ansOrNegative n = case n > 10^18 of
	True -> -1
	False -> n

main :: IO ()
main = do
	nS <- getLine
	let n = read nS
	interact 	$ show
				. ansOrNegative
				. foldl (*) 1 
				. map (read) 
				. take n 
				. words
