import java.io.*
import java.util.*

fun solve(N: Long, M: Long, a: LongArray) {
    val b = a.distinct()
    if (b.map { powerOf(it, 2) }.distinct().size >= 2) { println(0) } else {
        val g = b.map { it / 2L }.reduce { a, b -> a / gcd(a, b) * b }
        // 1 <= g * (2*m - 1) <= M
        // m = 1, 2, 3, ... , (M / g + 1) / 2
        println((M / g + 1) / 2)
    }
    return
}

tailrec fun gcd(x: Int, y: Int): Int = if (y == 0) x else gcd(y, x % y)
tailrec fun gcd(x: Long, y: Long): Long = if (y == 0L) x else gcd(y, x % y)

fun powerOf(x: Long, base: Long): Int {
    var count = 0
    var ret = x
    while (ret % base == 0L) {
        ret /= base
        count++
    }
    return count
}

fun main(args: Array<String>) {
    fun StringArray(size: Int, init: (Int) -> String = { "\u0000" }): Array<String> {
        return Array<String>(size, init)
    }
    class Scanner(stream: InputStream) {
        private val reader = BufferedInputStream(stream).bufferedReader()
        private var st: StringTokenizer? = null
        fun next(): String {
            while (!(st?.hasMoreTokens() ?: false)) st = StringTokenizer(reader.readLine())
            return st!!.nextToken()
        }
    }
    val sc = Scanner(System.`in`)
    val N = sc.next().toLong()
    val M = sc.next().toLong()
    val a = LongArray(N.toInt())
    for (i in 0 until N.toInt()) {
        a[i] = sc.next().toLong()
    }
    solve(N, M, a)
}
