main = do
  str <- getLine
  let n = read str ::Int
  str <- getLine
  let as = take n $ map read (words str) ::[Int]
  let as' = reverse as
  if 0 `elem` as'
    then print 0
    else print $ mul (head as') (tail as')
  

mul :: Int -> [Int] -> Int
mul acc (a:as)
  | acc * a > 10^18 = -1
  | as == []        = acc * a
  | otherwise       = mul (acc * a) as