local read = setmetatable({}, {__index = function(t, k) local a = {} for i=1,#k do table.insert(a, '*'..string.sub(k, i, i)) end local r = io.read local u = table.unpack or unpack return function() return r(u(a)) end end})
read.N = function(N) local t={} for i=1,N do t[i]=read.n() end return t end
string.totable = function(s) local t={} local u=string.sub for i=1,#s do t[i] = u(s, i, i) end return t end
string.split = function(s) local t={} for w in string.gmatch(s, "[^%s]+") do table.insert(t, w) end return (table.unpack or unpack)(t) end
----
local function gcd(a,b)
    if b == 0 then
        return a
    else
        return gcd(b, a % b)
    end
end

local function gcdmany(tbl)
    local ans = tbl[1]
    for i=2,#tbl do
        ans = gcd(ans, tbl[i])
    end
    return ans
end

local function lcm(a, b)
    return a // gcd(a, b) * b
end

local function lcmmany(tbl)
    local ans = tbl[1]
    for i=2, #tbl do
        ans = lcm(ans, tbl[i])
    end
    return ans
end
---
local N, M = read.nn()
local A = read.N(N)
table.sort(A)
local L = lcmmany(A)
local highest = A[#A]
local low_limit = A[1] // 2
local high_limit = M % L

local function check(x, ak)
    local x_shifted = x - ak // 2
    return x_shifted % ak == 0
end

local count_first_bad = 0
local count = 0
local count_last_bad = 0
local x = highest // 2
local function check2(x, ak)
    return x >= ak // 2
end
local function check3(x, ak)
    return x <= high_limit
end

while x <= L do
    local result = true
    local result_first = true
    local result_last = true
    for k, ak in ipairs(A) do
        result = result and check(x, ak)
        result_first = result_first and check2(x, ak)
        result_last = result_last and check3(x, ak)
    end
    if result then
        count = count + 1
        if not result_first then
            count_first_bad = count_first_bad + 1
        end
        if not result_last then
            count_last_bad = count_last_bad + 1
        end
    end
    x = x + highest
end
local roundup = L * math.ceil(M / L)
local cycles = roundup // L
--print(L, roundup, cycles, count, count_first_bad, count_last_bad)
local ans = cycles * count - count_first_bad - count_last_bad
print(ans)