#include<iostream>
#include<algorithm>
using namespace std;
typedef long long ll;

const int MAX_N = 202;
const int MAX_X = 1e5 + 1;
const ll MOD = 1e9 + 7;

int S[MAX_N];
ll dp[MAX_N][MAX_X];

int main() {
    int N, X;
    cin >> N >> X;
    for (int i = 0; i < N; i++) {
        cin >> S[i];
    }
    sort(S, S + N);
    reverse(S, S + N);
    dp[0][X] = 1;
    for (int i = 0; i < N; i++) {
        for (int j = 0; j <= X; j++) {
            dp[i + 1][j] = (dp[i + 1][j] + (dp[i][j] * (N - i - 1)) % MOD) % MOD;
            dp[i + 1][j % S[i]] = (dp[i + 1][j % S[i]] + dp[i][j]) % MOD;
        }
    }
    ll ans = 0;
    for (int i = 1; i <= X; i++) {
        ans = (ans + (dp[N][i] * i) % MOD) % MOD;
    }
    cout << ans << endl;
    return 0;
}