main = do
  getLine 
  a <- map read . words <$> getLine 
  if elem 0 a 
    then print 0
    else print $ get $ solve a 1


mul :: Integer -> Integer -> Maybe Integer
mul n m
  | n*m <= 1000000000000000000 = Just (n*m)
  | otherwise = Nothing 

get :: Maybe Integer -> Integer
get (Just n) = n
get Nothing  = -1      

solve :: [Integer] -> Integer -> Maybe Integer
solve [] cur = Just cur
solve (fa:sa) cur = do
  p <- mul cur fa
  solve sa p

      
      
