program semi_common_multiple
  implicit none
  integer :: n, i, c, c1 = 0
  integer(16) :: m, a(100000) = 0_16, l = 1_16, k
  read(*,*) n, m
  read(*,*) a(1:n)
  a(1:n) = a(1:n)/2_16
  k = a(1)
  do while (mod(k,2_16) == 0_16)
    k = k/2_16
    c1 = c1+1
  end do
  k = a(1)/k
  do i = 1, n
    c = 0
    do while (mod(a(i),2_16) == 0_16)
      a(i) = a(i)/2_16
      c = c+1
    end do
    if (c /= c1) then
      write(*,'(i0)') 0
      stop
    end if
    l = lcm(l,a(i))
    if (l > m/k) then
      write(*,'(i0)') 0
      stop
    end if
  end do
  write(*,'(i0)') (m/k/l+1_16)/2_16
contains
  integer(16) function lcm(a,b)
    integer(16), intent(in) :: a, b
    lcm = a/gcd(a,b)*b
  end
  integer(16) function gcd(a,b)
    integer(16), intent(in) :: a, b
    integer(16) :: x, y
    x = max(a,b)
    y = min(a,b)
    do while (y > 0_16)
      gcd = y
      y = mod(x,y)
      x = gcd
    end do
  end
end program semi_common_multiple