fun main(args: Array<String>) {
    abc150d()
}

fun abc150d() {
    val (n, m) = readLine()!!.split(' ').map { it.toLong() }
    val aList = readLine()!!.split(' ').map { it.toLong() }

    val div2Count = aList.map {
        var curr = it
        var count = 0
        while (curr % 2 == 0L) {
            curr /= 2
            count++
        }
        count
    }.distinct()

    if (div2Count.size != 1) return println(0)

    val answer = m / aList.map { it / 2 }.reduce { acc, l -> lcm(acc, l) } -
            m / aList.reduce { acc, l -> lcm(acc, l) }

    println(answer)
}

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

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