#include <algorithm>
#include <bits/stdc++.h>
#include <cmath>
#include <cstdint>
#include <iostream>
#include <iterator>
#include <tuple>
#include <vector>

// lib/detail/ceil_and_floor.hpp
#ifndef DETAIL_CEIL_AND_FLOOR_HPP
#define DETAIL_CEIL_AND_FLOOR_HPP

namespace tools {
  template <typename T>
  constexpr T floor(T lhs, T rhs);

  template <typename T>
  constexpr T ceil(T lhs, T rhs);

  template <typename T>
  constexpr T floor(const T lhs, const T rhs) {
    return
      lhs >= 0 && rhs >= 0 ?
        lhs / rhs :
      lhs < 0 && rhs >= 0 ?
        -ceil<T>(-lhs, rhs) :
      lhs >= 0 && rhs < 0 ?
        -ceil<T>(lhs, -rhs) :
        floor<T>(-lhs, -rhs);
  }

  template <typename T>
  constexpr T ceil(const T lhs, const T rhs) {
    return
      lhs >= 0 && rhs >= 0 ?
        (lhs - 1 + rhs) / rhs :
      lhs < 0 && rhs >= 0 ?
        -floor<T>(-lhs, rhs) :
      lhs >= 0 && rhs < 0 ?
        -floor<T>(lhs, -rhs) :
        ceil<T>(-lhs, -rhs);
  }
}

#endif

// lib/quo.hpp
#ifndef QUO_H
#define QUO_H

/*
a == tools:quo(a, b) * b + tools::mod(a, b)
0 <= tools::mod(a, b) < std::abs(b)
*/

namespace tools {
  template <typename T>
  constexpr T quo(const T lhs, const T rhs) {
    return lhs > 0 ? lhs / rhs : rhs > 0 ? -((-lhs - 1 + rhs) / rhs) : (-lhs - 1 + -rhs) / -rhs;
  }
}

#endif

// lib/ntz.hpp
#ifndef NTZ_HPP
#define NTZ_HPP


namespace tools {
  std::uint32_t ntz(const std::uint32_t x);
}

#endif

// lib/bitcount.hpp
#ifndef BITCOUNT_HPP
#define BITCOUNT_HPP


namespace tools {
  std::uint32_t bitcount(std::uint32_t x);
  std::uint64_t bitcount(std::uint64_t x);
}

#endif

// lib/util.hpp
#ifndef UTIL_HPP
#define UTIL_HPP


typedef ::std::int_fast64_t i64;
typedef ::std::uint_fast64_t u64;
typedef ::std::int_fast32_t i32;
typedef ::std::uint_fast32_t u32;

namespace tools {
  template <typename T>
  void read(::std::istream& is, ::std::vector<T>& vector, const typename ::std::vector<T>::size_type size) {
    vector.reserve(size);
    ::std::copy_n(::std::istream_iterator<T>(is), size, ::std::back_inserter(vector));
  }
  template <typename T>
  void read(::std::vector<T>& vector, const typename ::std::vector<T>::size_type size) {
    ::tools::read(::std::cin, vector, size);
  }

  template <typename T, ::std::size_t N>
  void read(::std::istream& is, ::std::array<T, N>& array) {
    ::std::copy_n(std::istream_iterator<T>(is), N, array.begin());
  }
  template <typename T, ::std::size_t N>
  void read(::std::array<T, N>& array) {
    ::tools::read(::std::cin, array);
  }
}

#endif

// lib/ceil.hpp
#ifndef CEIL_HPP
#define CEIL_HPP


/*
usage:

tools::ceil(5, 3) // => 2 (i.e., ceil(5 / 3))
*/

#endif

// lib/extgcd.hpp
#ifndef EXTGCD_HPP
#define EXTGCD_HPP


/*
usage:

std::tuple<int, int, int> result = tools::extgcd(4, 5);
int gcd = std::get<0>(result);
int x0 = std::get<1>(result);
int y0 = std::get<2>(result);
*/

namespace tools {
  template <typename T>
  std::tuple<T, T, T> extgcd(T prev_r, T r) {
    T prev_s = 1;
    T prev_t = 0;
    T s = 0;
    T t = 1;
    while (r != 0) {
      const T q = quo(prev_r, r);
      const T next_r = prev_r - q * r;
      prev_r = r;
      r = next_r;
      const T next_s = prev_s - q * s;
      prev_s = s;
      s = next_s;
      const T next_t = prev_t - q * t;
      prev_t = t;
      t = next_t;
    }
    return std::make_tuple(std::abs(prev_r), prev_s, prev_t);
  }
}

#endif

// lib/ntz.cpp

namespace tools {
  std::uint32_t ntz(const std::uint32_t x) {
    return bitcount((x & -x) - 1u);
  }
}

// lib/bitcount.cpp

namespace tools {
  std::uint32_t bitcount(std::uint32_t x) {
    x = (x & static_cast<std::uint32_t>(0x55555555ull)) + (x >> static_cast<std::uint32_t>(1) & static_cast<std::uint32_t>(0x55555555ull));
    x = (x & static_cast<std::uint32_t>(0x33333333ull)) + (x >> static_cast<std::uint32_t>(2) & static_cast<std::uint32_t>(0x33333333ull));
    x = (x & static_cast<std::uint32_t>(0x0f0f0f0full)) + (x >> static_cast<std::uint32_t>(4) & static_cast<std::uint32_t>(0x0f0f0f0full));
    x = (x & static_cast<std::uint32_t>(0x00ff00ffull)) + (x >> static_cast<std::uint32_t>(8) & static_cast<std::uint32_t>(0x00ff00ffull));
    return (x & static_cast<std::uint32_t>(0x0000ffffull)) + (x >> static_cast<std::uint32_t>(16) & static_cast<std::uint32_t>(0x0000ffffull));
  }

  std::uint64_t bitcount(std::uint64_t x) {
    x = (x & static_cast<std::uint64_t>(0x5555555555555555ull)) + (x >> static_cast<std::uint64_t>(1) & static_cast<std::uint64_t>(0x5555555555555555ull));
    x = (x & static_cast<std::uint64_t>(0x3333333333333333ull)) + (x >> static_cast<std::uint64_t>(2) & static_cast<std::uint64_t>(0x3333333333333333ull));
    x = (x & static_cast<std::uint64_t>(0x0f0f0f0f0f0f0f0full)) + (x >> static_cast<std::uint64_t>(4) & static_cast<std::uint64_t>(0x0f0f0f0f0f0f0f0full));
    x = (x & static_cast<std::uint64_t>(0x00ff00ff00ff00ffull)) + (x >> static_cast<std::uint64_t>(8) & static_cast<std::uint64_t>(0x00ff00ff00ff00ffull));
    x = (x & static_cast<std::uint64_t>(0x0000ffff0000ffffull)) + (x >> static_cast<std::uint64_t>(16) & static_cast<std::uint64_t>(0x0000ffff0000ffffull));
    return (x & static_cast<std::uint64_t>(0x00000000ffffffffull)) + (x >> static_cast<std::uint64_t>(32) & static_cast<std::uint64_t>(0x00000000ffffffffull));
  }
}

// main.cpp

int main() {
  i64 N, M;
  std::cin >> N >> M;
  std::vector<i64> a;
  tools::read(a, N);

  std::transform(a.begin(), a.end(), a.begin(), [](const i64& a_i) { return a_i / 2; });
  const i64 ntz = tools::ntz(a.front());
  if (std::any_of(a.begin(), a.end(), [&ntz](const i64& a_i) { return tools::ntz(a_i) != ntz; })) {
    std::cout << 0 << std::endl;
    return 0;
  }

  i64 lscm = 1;
  for (const i64& a_i : a) {
    lscm = lscm * a_i / std::get<0>(tools::extgcd(lscm, a_i));
    if (lscm > M) {
      std::cout << 0 << std::endl;
      return 0;
    }
  }

  std::cout << tools::ceil<i64>(M / lscm, 2) << std::endl;
  return 0;
}

Measured memory_bytes: 1024