solve [] acc = acc
solve _ 0 = 0
solve (a:as) acc
    | acc > (10^18) = -1
    | otherwise = solve as (acc*a)


main = do
    n <- getLine
    an <- map read <$> (words <$> getLine) :: IO [Integer]
    print $ if elem 0 an then 0  else solve an 1
