toInteg :: String -> Integer
toInteg = read :: String -> Integer

main :: IO ()
main = do
    n <- getLine
    an <- map toInteg . words <$> getLine
    let resulte = product an
    if resulte > (10^18)
        then putStrLn $ "-1"
        else putStrLn $ show $ resulte
        