
ret [] k = k
ret (a:as) k 
  | a * k > 1000000000000000000 = -1
  | otherwise = ret as (a * k)

main = do
  n <- getLine
  as <- (map read . words) <$> getLine
  putStrLn $ show $ if (0 `elem` as ) then 0 else ret as 1
