#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
int N,X;
vector<int>S;
long mod=1e9+7,dp[222][1<<17];
int main()
{
	cin>>N>>X;
	for(int i=0;i<N;i++)
	{
		int s;cin>>s;S.push_back(s);
	}
	sort(S.begin(),S.end());
	dp[0][X]=1;
	for(int i=0;i<N;i++)
	{
		for(int j=0;j<=X;j++)
		{
			if(dp[i][j]==0)continue;
			int k=0;
			for(;k<N;k++)
			{
				if(j<S[k])break;
				(dp[i+1][j%S[k]]+=dp[i][j])%=mod;
			}
			(dp[i+1][j]+=dp[i][j]*(N-k-i)%mod)%=mod;
		}
	}
	long ans=0;
	for(int i=0;i<=X;i++)(ans+=i*dp[N][i])%=mod;
	cout<<ans<<endl;
}