import Control.Monad
import Data.Maybe
import qualified Data.ByteString.Char8 as B
import qualified Data.Vector.Unboxed   as U

readIntN :: Int -> IO (U.Vector Int)
readIntN n = U.unfoldrN n (B.readInt . B.dropWhile (== ' ')) <$> B.getLine

main :: IO ()
main = do
  n <- readLn
  as <- readIntN n
  print $ fromMaybe (-1) $ solve as

solve :: U.Vector Int -> Maybe Integer
solve as = do
  let f = \s a -> s * fromIntegral a
  s <- return $ U.foldl' f 1 as
  guard $ s <= 10 ^ 18
  return s
 