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