#include <iostream>
#include <cstdio>
#define N 100005
using namespace std;

typedef long long ll;
ll n, m, x = 1, a[N];

ll gcd(ll p, ll q) {
	if (q == 0) return p;
	return gcd(q, p % q);
}

int main()
{
	ll i, t;
	cin >> n >> m;
	for (i = 0; i < n; i++) {
		scanf("%lld", &a[i]);
		a[i] /= 2;
		x *= a[i] / gcd(x, a[i]);
	}
    for (i = 0; i < n; i++) {
		if (x / a[i] % 2 == 0) {puts("0"); return 0;}
    }
    t = m / x;
    t = (t + 1) / 2;
    cout << t << endl;
    return 0;
}