main :: IO ()
main = do
    l1 <- getLine
    l2 <- getLine
    let a = map read $ words l2 :: [Integer]
    print $ f 1 a

f y [] = if y > 10 ^ 18
	then -1
    else y
f y (x:xs) = if y > 10 ^ 18
    then (if 0 `elem` xs then 0 else -1)
    else f (y*x) xs
