n,m = gets.chomp.split(" ").map(&:to_i)
a = gets.chomp.split(" ").map(&:to_i)
lcm = 1
odd = false
even = false
a.each do |x|
  lcm = (x/2).lcm(lcm)
  odd = true if (x/2)%2 == 1
  even = true if (x/2)%2 == 0
end
if odd && even
  puts 0
else
  cnt = m/lcm - m/(lcm*2)
  puts cnt
end