#include <bits/stdc++.h>
#define rep(i,n) for(int i = 0; i < n; i++)
using namespace std;
typedef long long ll;
typedef pair<ll,ll> P;
 
const double EPS = 1e-10;
const ll INF = 100000000;
const ll MOD = 1000000007;

int n, x;
int s[200];
ll dp[201][100001];

int main() {
    cin >> n >> x;
    rep(i,n) cin >> s[i];
    sort(s,s+n,greater<int>());
    dp[0][x] = 1;
    rep(i,n) {
        rep(j,x+1) dp[i+1][j] = (dp[i][j] * (n-i-1))%MOD;
        rep(j,x+1) {
            dp[i+1][j%s[i]] = (dp[i+1][j%s[i]] + dp[i][j])%MOD;
        }
    }
    ll ans = 0;
    rep(j,x+1) {
        ans = (ans + dp[n][j]*j) % MOD;
    }
    cout << ans << endl;
}

