n,m = gets.chomp.split.map(&:to_i)
a = gets.chomp.split.map(&:to_i).sort
a.map!{|x| x/=2}

l = a[0]
for i in 1..n-1
    if l<m
        g = l.gcd(a[i])
        pa = a[i]/g
        pl = l/g
        if pa.even? || pl.even?
            puts 0
            exit
        else
            l =  g*pa*pl
        end
    else
        puts 0
        exit
    end
end

puts (m-l)/(l*2)+1