io = STDIN
n,m=io.gets.split.map(&:to_i)
ar=io.gets.split.map(&:to_i).uniq
half=ar.map{|i|i/2}

def lcm(ar)
  ar.inject(ar.first){|i,s|i.lcm(s)}
end
def gcd(ar)
  ar.inject(ar.first){|i,s|i.gcd(s)}
end
lcm1=lcm(ar)
lcm2=lcm1/2
if gcd(ar)==2
  if lcm2>m
    puts 0
  else
    puts (m-lcm2)/lcm1+1
  end
else
  puts 0
end
