#include <bits/stdc++.h>

using namespace std;

using ll = long long;

constexpr ll MOD = 1e9 + 7;

ll N, X;
vector<ll> s;
vector<vector<ll>> memo;

ll Rec(int idx, ll x) {
    if (idx == N) return x;
    if (memo[idx][x] != -1) return memo[idx][x];

    ll &res = memo[idx][x];
    res = Rec(idx + 1, x % s[idx]) % MOD;
    (res += Rec(idx + 1, x) * (N - idx - 1)) %= MOD;

    return res;
}

int main() {
    cin.tie(0); ios::sync_with_stdio(false);

    cin >> N >> X;
    s.resize(N);
    for (auto &s_i : s) cin >> s_i;
    sort(s.begin(), s.end(), greater<ll>());

    memo.resize(N, vector<ll>(X + 1, -1));
    cout << Rec(0, X) << endl;

    return 0;
}
