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

main :: IO ()
main = do
  n <- unsafeTextToInt <$> T.getLine :: IO Int
  as <- map unsafeTextToInteger . T.words <$> T.getLine :: IO [Integer]
  let
    p = product as :: Integer
  print $ if 10 ^ 18 < p then -1 else 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 #-}
