import qualified Data.Text as T
import qualified Data.Text.IO as T
import qualified Data.Text.Read as T

main :: IO ()
main = do
  let
    m = 10 ^ 18 :: Integer
  n <- unsafeTextToInt <$> T.getLine :: IO Int
  as <- map unsafeTextToInteger . T.words <$> T.getLine :: IO [Integer]
  let
    p = foldl step (Just 1) as :: Maybe Integer
      where
        step :: Maybe Integer -> Integer -> Maybe Integer
        step Nothing 0 = Just 0
        step Nothing _ = Nothing
        step (Just x) y | z <= m    = Just z
                        | otherwise = Nothing
          where
            z = x * y :: Integer
  print . maybe (-1) id $ p

unsafeTextToInt :: T.Text -> Int
unsafeTextToInt s = case T.signed T.decimal s of
  Right (n, _) -> n
{-# INLINE unsafeTextToInt #-}

unsafeTextToInteger :: T.Text -> Integer
unsafeTextToInteger s = case T.signed T.decimal s of
  Right (n, _) -> n
{-# INLINE unsafeTextToInteger #-}
