import Control.Monad
import Data.Maybe
import Data.Word
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
  case solve as of
    Nothing -> print (-1)
    Just p  -> print p

solve :: U.Vector Int -> Maybe Word64
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 * fromIntegral a
 