import Data.List

toInt :: String -> Int
toInt = read :: String -> Int

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

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