import java.util.*

fun main(args: Array<String>) {
    val sc = java.util.Scanner(System.`in`)
    val n = sc.nextInt()
    val m: Long = sc.nextLong() * 2
    val a = sc.asSequence().take(n).map { it.toLong() }.toList()

    val c: Long = a.reduce { acc, v -> lcm(acc, v) }

    if (a.any { (c / it) % 2 == 0L }) {
        print(0)
        return
    }
    var r = 0
    var cc: Long = c
    while (cc <= m) {
//        if (cc % 2 == 1L) {
            r++
//        }
        cc += c * 2
    }
    print(r)
}

fun lcm(a: Long, b: Long): Long {
    var a = a
    var b = b
    var temp: Long
    var c = a
    c *= b
    while (true) {
        temp = a % b
        if (temp == 0L) {
            break
        }
        a = b
        b = temp
    }
    return (c / b)
}