tailrec fun gcd(a: Long, b: Long): Long {
    return if (b == 0L) a else gcd(b, a % b)
}

fun lcm(a: Long, b: Long): Long {
    return a * b / gcd(a, b)
}

fun main(args: Array<String>) {
    val (n, m) = readLine()?.split(" ")?.map(String::toLong) ?: return
    val aList = readLine()?.split(" ")?.map(String::toLong) ?: return
    aList.map {
        var r = it
        var count = 0
        while (r % 2 == 0L) {
            count++
            r /= 2
        }
        count
    }.distinct().size.apply {
        if (this != 1) {
            println(0L)
            return
        }
    }

    //最小公倍数を求めて割る
    val ak = aList.fold(1L) { a, b -> lcm(a, b) }
    val ak2 = aList.map { it / 2 }.fold(1L) { a, b -> lcm(a, b) }
    val count = m / ak2 - m / ak
    println(count)
}

