#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < n; i++)
using namespace std;
typedef long long int ll;

ll gcd(ll x, ll y) { return y ? gcd(y, x%y) : x;}
ll lcm(ll x, ll y) { return x / gcd(x, y) * y;}

int main() {
  ll n, m; cin >> n >> m;
  vector<int> a(n); rep(i, n) cin >> a[i];
  ll G = 1;
  rep(i, n) G = lcm(G, a[i]);
  rep(i, n) {
    if (G / 2 % a[i] == 0) {
      cout << 0 << endl;
      return 0;
    }
  }
  cout << (m * 2 / G + 1) / 2 << endl;
  return 0;
}
