fun main(args: Array<String>) {
    val (N, M) = listOfLong()
    val A = listOfLong().map { it / 2 }
    val L = A.reduce { acc, a -> lcm(acc, a) }
    if (A.any { (L / it) % 2 == 0L }) {
        println(0)
        return
    }
    var ans = M / L
    ans = (ans + 1) / 2
    println(ans)
}
fun gcd(a: Long, b: Long): Long = if (b > 0) gcd(b, a % b) else a
fun lcm(a: Long, b: Long): Long = a / gcd(a, b) * b
fun next() = readLine()!!
fun listOfString() = next().split(" ")
fun listOfLong(delta: Long = 0L) = listOfString().map { java.lang.Long.parseLong(it) + delta }
