n, m = gets.split.map(&:to_i)
a = gets.split.map(&:to_i)

l = 1
for i in 0...n do
  l = l.lcm(a[i] / 2)
end

def two(n)
  res = 0
  while n % 2 == 0 do
    res += 1
    n /= 2
  end
  res
end

b = a.map{|x| two(x)}
if b.min == b.max then
  puts ((m / l) - m / (2 * l))
else
  puts 0
end