#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;

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<int> p0(x + 1), p1(x + 1);
    for (int j = 0; j <= x; j++) {
        p0[j] = j % s[0];
    }
    for (int i = 1; i < n; i++) {
        for (int j = 0; j <= x; j++) {
            p1[j] = (p0[j % s[i]] + p0[j] * (ll)i) % P;
        }
        swap(p0, p1);
    }

    cout << p0[x] << endl;

    return 0;
}