program semi_common_multiple
    implicit none
    integer(16):: n, m, i
    integer(16), allocatable:: a(:)
    integer(16):: gcd, lcm

    read*, n, m
    allocate(a(n))
    read*, a(:)
    a(:) = a(:) / 2_16

    do while(mod(a(1), 2) == 0)
        do i=1, n
            if(mod(a(i),2) /= 0)then
                print*, 0
                stop
            endif
            a(i) = a(i) / 2
        end do
            m = m / 2
    end do

    lcm = 1

    do i=1,n
        gcd = calc_gcd(lcm,a(i))
        lcm = lcm/gcd*a(i)
    end do

    print*, (m/lcm+1_16)/2_16

contains
recursive function calc_gcd(a,b) result(ret)
integer(16):: a, b, r, ret
    if (mod(a,b) == 0)then
        ret = b
        return
    end if
    ret = calc_gcd(b,mod(a,b))
end function
end program