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 Int
solve = U.foldl' f (Just 1)
 where
  f Nothing  0 = Just 0
  f Nothing  _ = Nothing
  f (Just 0) _ = Just 0
  f (Just x) a
    | x1 > 1000000000000000000 = Nothing
    | otherwise                = Just x1
   where
    x1 = x * a
 