#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <cstdio>
#include <cstring>
#include <cmath>
using namespace std;
using ll = long long;

constexpr int P = 1000000007;

template <class S, class DP>
int f(int n, int x, const S& s, DP& dp) {
    if (n == 1) return x % s[n - 1];
    if (dp[n][x] >= 0) return dp[n][x];

    ll r = 0;
    r += f(n - 1, x % s[n - 1], s, dp);
    r += f(n - 1, x, s, dp) * (ll)(n - 1);
    return dp[n][x] = r % P;
}

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

    int n, x;
    cin >> n >> x;

    vector<int> s(n);
    for (int i = 0; i < n; i++) {
        cin >> s[i];
    }
    sort(s.begin(), s.end());

    vector<vector<int>> dp(n + 1, vector<int>(x + 1, -1));

    cout << f(n, x, s, dp) << endl;

    return 0;
}