import Data.List
main = do
  _ <- getLine
  numList <- map read . words <$> getLine
  let result = foldl1' (\acc x -> if acc*x > 10^18 then 0 else acc*x) numList
  print $ if (result==0) && not(elem 0 numList) then -1 else result