n,m = gets.chomp.split(" ").map(&:to_i)
a = gets.chomp.split(" ").map(&:to_i)
lcm = 1
hash = Hash.new(0)
a.each do |x|
  lcm = (x/2).lcm(lcm)
  v = x
  cnt = 0
  while v % 2 == 0
    v = v / 2
    cnt += 1
  end
  hash[cnt] += 1
end
if hash.length >= 2 
  puts 0
else
  cnt = m/lcm - m/(lcm*2)
  puts cnt
end