n,m=gets.split.map(&:to_i)
a=gets.split.map(&:to_i).map{|n|n/2}
#a=a.map{|n| n/2}
#n.times do |i|
#  a[i]/=2
#end
b=1
a.each do |aa|
  b=b.lcm(aa)
end
if b.even?
  a.each do |aa|
    if aa.odd? || (b/aa).even?
      puts 0
      exit
    end
  end
end
puts (m/b+1)/2
