import           Data.List (foldl')

main :: IO ()
main = do
  _ <- getLine
  as <- getLine
  let (_, a) = foldl'
        (\(over, acc) a
         -> let a' = read a :: Integer
                temp = a' * acc
            in if a' == 0
               then (False, 0)
               else if over
                    then (over, acc)
                    else if temp > u
                         then (True, -1)
                         else (False, temp))
        (False, 1)
        (words as)
      b = if a > u || a < 0
          then -1
          else a
      u = 10 ^ 18
  print b
