import Data.List

toInteg :: String -> Integer
toInteg = read :: String -> Integer

prod :: Integer -> [Integer] -> Integer
prod n l
  | n > 10^18 = -1
  | l == [] = n
  | otherwise = prod (n * (head l)) (tail l)

main = do
  n <- toInteg <$> getLine
  a <- map toInteg . words <$> getLine
  print $ prod 1 (sort a)
