
fun main(arr:Array<String>) {
    val (itemCount,rangeEnd) = readLine()!!.split(" ") .map { it.toLong() }
    val numList = readLine()!!.split(" ").map { it.toLong() }
    if(numList.map { div2Count(it) }.sorted().let { it.first() != it.last() }) {
        println(0)
        return
    }

    val minKoubai = numList.map { it/2 }.reduce { acc, l -> getKoubai(acc, l) }
    var maxKoubai = rangeEnd / minKoubai
    if(maxKoubai % 2 == 0L) {
        maxKoubai--
    }
    if(maxKoubai <= 0) {
        println(0)
        return
    }
    println((maxKoubai+1)/2)
}

fun getKoubai(num1:Long,num2:Long):Long {
    val kouyaku = getKouyaku(num1, num2)
    return kouyaku * (num1/kouyaku) * (num2/kouyaku)
}
fun getKouyaku(num1:Long, num2:Long):Long {
    if(num1 % num2 == 0L) {
        return num2
    }
    return getKouyaku(num2, num1 % num2)
}

fun div2Count(num:Long):Int {
    var ans = 0
    var current = num
    while (current%2==0L) {
        ans++
        current /= 2
    }
    return ans
}
