main = do
  n:m:_ <- map read . words <$> getLine :: IO [Int]
  as <- map read . words <$> getLine :: IO [Int]
  putStrLn $ show $ count m as

count m as | foldl step False bs = 0
           | otherwise = (div m k + 1) `div` 2
    where bs = map (\x -> div x 2) as
          k = foldl lcm 1 bs
          step a x = a || even (div k x)
