#include <bits/stdc++.h>
using namespace std;
#define int long long

const int MAX= 1E5+5;
const int MAXN = 205;
const int MOD = 1E9+7;

int n, X;
vector<int> a(MAXN);
int f[MAXN][MAX];

int dp(int i, int cur){
	int& ret = f[i][cur];
	if(ret != -1) return ret;
	if(i==0) return ret = (cur < a[1]? cur : 0);
	ret = (dp(i-1, cur%a[i]) + (i-1)*dp(i-1, cur))%MOD;
	return ret;
}

signed main() {
	cin >> n >> X;
	for(int i=1; i<= n; ++i) cin >> a[i];
	sort(a.begin()+1, a.begin()+n+1);
	memset(f, -1, sizeof f);
	cout << dp(n, X);
	return 0;
}