import           Data.List (foldl')
import qualified Data.ByteString.Char8 as BS
import           Data.Maybe (fromJust)

main :: IO ()
main = do
  _ <- BS.getLine
  as <- fmap (fst . fromJust . BS.readInteger) . BS.words <$> BS.getLine
  let (_, result) = foldl' f (False, 1) as
        where
          f _ 0 = (False, 0)
          f (True, _) _ = (True, -1)
          f (False, acc) a = let temp = a * acc
                             in if temp > maxValue
                                then (True, -1)
                                else (False, temp)
      maxValue = 10 ^ (18 :: Integer)
  print result
