solve [] acc = acc
solve _ 0 = 0
solve (a:as) acc = solve as (acc*a)


main = do
    n <- getLine
    an <- map read <$> (words <$> getLine) :: IO [Integer]
    let res = solve an 1
    print $ if res > (10^18) then -1 else res
