main = do
  getLine 
  a <- map read . words <$> getLine
  print $ solve a

solve :: [Int] -> Int
solve a
  | 0 `elem` a = 0
  | n > 1000000000000000000 = -1
  | otherwise = n
  where
      n = product a
