#include<bits/stdc++.h>
using namespace std;
const int mod = 376544743;
const int N = 3e2 + 15;
long long ans = 0,a[N],n,m;
long long qz(long long x) {
long long sum = m / x;
return sum % 2 == 0?((x + sum * x) * (sum / 2)) % mod:((x + sum * x) * (sum / 2) + x * ((sum + 1) / 2)) % mod;
}
int main() {
scanf("%lld%lld",&n,&m);
for(int i = 1; i <= n; i ++) {
scanf("%lld",&a[i]);
ans = (ans + qz(a[i])) % mod;
}
for(int i = 1; i <= n; i ++) {
for(int j = i + 1; j <= n; j ++) {
ans = (ans + mod - qz(a[i] * a[j])) % mod;
}
}
printf("%lld\n",ans);
return 0;
}