import qualified Data.ByteString.Char8 as BS
import qualified Data.Vector.Unboxed as V
import           Data.Maybe (fromJust)
import           Data.Char (isSpace)

main :: IO ()
main = do
  n <- fst . fromJust . BS.readInt <$> BS.getLine
  as <- getIntVec n
  let (_, result) = V.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

getIntVec :: Int -> IO (V.Vector Int)
getIntVec n = V.unfoldrN n (BS.readInt . BS.dropWhile isSpace) <$> BS.getLine
