import           Data.List (foldl')

main :: IO ()
main = do
  _ <- getLine
  as <- fmap read . words <$> getLine :: IO [Integer]
  let a = foldl' (*) 1 as
      b = if a > 10 ^ 18
          then -1
          else a
  print b
