import Control.Monad
import Data.Maybe
import qualified Data.ByteString.Char8 as BS
import Data.List

readInt = fst . fromJust . BS.readInt
readIntList = map readInt . BS.words
getInt = readInt <$> BS.getLine
getIntList = readIntList <$> BS.getLine

main = do
    [n, m] <- getIntList
    as <- getIntList
    print $ solve as m

solve as m | all (== d) as' = (m `div` l + 1) `div` 2
           | otherwise = 0
    where as' = map div2 as
          d = head as'
          l = foldl lcm 1 $ map (`div` (2 ^ d)) as

div2 a | a `mod` 2 == 0 = 1 + div2 (a `div` 2)
       | otherwise = 0