object Main extends App {

  def gcd(a: Long, b: Long): Long = if (b == 0)
    a
  else
    gcd(b, a % b)

  def lcm(a: Long, b: Long): Long = a * b / gcd(a, b)

  def lcm(list: Seq[Long]): Long = list.reduceLeft(lcm)

  def countDivide2(a: Long, acc: Int): Int = if (a % 2 == 0)
    countDivide2(a / 2, acc + 1)
  else
    acc

  val Array(_, m) = io.StdIn.readLine().split(' ').map(_.toLong)
  val a = io.StdIn.readLine().split(' ').map(_.toLong).distinct

  val answer = if (a.map(countDivide2(_, 0)).distinct.size != 1)
    0
  else {
    val lcmHalf = lcm(a.map(_ / 2))
    math.ceil((m / lcmHalf).toDouble / 2.0)
  }

  println(answer.toLong)
}
