program speedrun
implicit none
integer(16)::N,M
integer(16),allocatable,dimension(:)::a
integer(16)::D,T
logical::Check2
integer(16)::i
read*,N,M
allocate(a(N))
read*,A
D=1_16
do
    if(mod(a(1),2_16**(D+1_16))/=0_16)exit
    D=D+1_16
end do
Check2=.true.
do i=1,N
    if(mod(A(i),2**D)/=0.or.mod(A(I),2**(D+1_16))==0_16)Check2=.false.
end do
T=(A(1)/2)*(A(2)/2)/gcd(A(1)/2,A(2)/2)
do i=3_16,N
    T=T*(A(i)/2_16)/gcd(T,A(i)/2_16)
end do
print"(i0)",merge((M/T+1_16)/2_16,0_16,Check2)
contains
integer(16) recursive function gcd(a, b)result(res)
  integer(16), intent(in)::a, b
  res=merge(b, gcd(b, mod(a, b)),mod(a, b)==0_16)
end function
end program speedrun