#include<bits/stdc++.h>
#define fo(i,a,b) for(int i=a;i<=b;i++)
#define fd(i,a,b) for(int i=a;i>=b;i--)
using namespace std;

typedef long long LL;

const int maxn=205, maxx=1e5+5;
const LL mo=1e9+7;

int n,x,a[maxn];

bool cmpA(int a,int b) {return a>b;}

LL f[maxn][maxx];
int main()
{
	scanf("%d %d",&n,&x);
	fo(i,1,n) scanf("%d",&a[i]);
	sort(a+1,a+1+n,cmpA);
	
	f[0][x]=1;
	fo(i,0,n-1)
	{
		fo(j,0,x)
		{
			(f[i+1][j]+=f[i][j]*(n-i-1))%=mo;
			(f[i+1][j%a[i+1]]+=f[i][j])%=mo;
		}
	}
	
	LL ans=0;
	fo(j,0,x) (ans+=f[n][j]*j)%=mo;
	
	printf("%lld\n",ans);
}