fun main(args: Array<String>) {
    var (N, M) = readInputLine().split(" ").map { it.toLong() }
    val aArr = readInputLine().split(" ").map { it.toLong() / 2L }.toLongArray()

    while (aArr[0] % 2L == 0L) {
        for (i in 0 until N.toInt()) {
            if (aArr[i] % 2L != 0L) {
                println(0)
                return
            }
            aArr[i] /= 2L
        }
        M /= 2L
    }

    if (aArr.any { it % 2L == 0L }) {
        println(0)
        return
    }

    var lcm = aArr[0]

    for (a in aArr) {
        val gcd = gcd(lcm, a)
        lcm = lcm / gcd * a
        if (lcm > M) {
            println(0)
            return
        }
    }

    val ans = if (M / lcm % 2L == 0L) M / lcm / 2L else M / lcm / 2L + 1L

    println(ans)
}

fun readInputLine(): String {
    return readLine()!!
}

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