main :: IO ()
main = do
  _ <- getLine
  as <- fmap read . words <$> getLine
  let (_, a) = foldr
        (\a (over, acc)
         -> let 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)
        as
      u = 10 ^ (18 :: Integer)
  print a
