#include <bits/stdc++.h>
using namespace std;
typedef int64_t LL;
LL GCD(LL a,LL b){return(b==0)?a:GCD(b,a%b);}
LL LCM(LL a,LL b){return a*b/GCD(a,b);}
int main()
{
  int A,N,M;
  LL x=1;
  cin>>N>>M;
  while(cin>>A){x=LCM(x,(A+1)/2);if(x>M||(2*x/A)%2==0)return cout<<0<<endl,0;}
  return cout<<(M/x+1)/2<<endl,0;
}