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 <- map (`div` 2) <$> getIntList
    print $ solve as m

solve as m | and (map odd as) = (m `div` l + 1) `div` 2
           | otherwise = 0
    where l = foldl lcm 1 as