#include<cstdio>
#include<algorithm>
#include<iostream>
#include<cstdlib>
#include<cmath>
#include<cstring>
#include<string>
#define ll long long
#define mod 376544743
using namespace std;
ll sn(ll a1,ll an,ll n)//等差数列求和
{
return (a1+an)%mod*n%mod*188272372%mod; //当时忘了搞2对于mod的乘法逆元了,然后就wrong了
}
int count(int n)
{
int ans;
for (ans=0;n;n=n&(n-1)) ans++;
return ans;
}
ll n,m,p[50],ans;
int main()
{
scanf("%lld%lld",&n,&m);
for (int i=1;i<=n;i++) scanf("%lld",&p[i]);
for (int i=1;i<(1<<n);i++)//枚举子集
{
int j=i;
ll k=count(j),g=0,t=1;
for (int l=0;l<n;l++) if (j&(1<<l)) t*=p[l+1];
if (t>m) continue;
g=sn(t,(m/t)*t,m/t);
if (k&1) ans=(ans+g)%mod; //容斥原理
else ans=(ans+mod-g)%mod;
}
printf("%lld",ans);
return 0;
}