import Data.List
main = do
  _ <- getLine
  numList <- sort . map read . words <$> getLine
  if (head numList)==0 
    then print 0
    else let result = foldr1 (\acc x -> if acc*x > 10^18 then 0 else acc*x) numList in print $ if (result==0) then -1 else result