import Data.Maybe
import Control.Monad
import qualified Data.ByteString.Char8 as C

readInt' = fst.fromJust.C.readInt
readLnInt = map readInt'.C.words<$>C.getLine
readCsInt n = concat<$>replicateM n readLnInt

x ? (a,b) = if x then a else b

main = do
 getLine
 inputs <- readLnInt
 print $ solve inputs

solve s
 | any (==0) s = 0
 | otherwise = calc 1 s

calc tmp [] = tmp
calc tmp (a:as)
 | prod > limit = (-1)
 | otherwise = calc prod as
  where
   prod = tmp*a

limit = 10^18
