#include <bits/stdc++.h>

using namespace std;

typedef long long i64;

const i64 NMAX = 200;
const i64 VMAX = 1e5;
const i64 MOD  = 1e9 + 7;

i64 d[NMAX+2][VMAX+2];
i64 v[NMAX+2];
i64 N, start;

int main()
{
    cin >> N >> start;
    for( i64 i = 1;  i <= N;  ++i ) {
        cin >> v[i];
    }
    sort( v +1, v+N+1 );
    for( i64 val = 0;  val <= VMAX;  ++val )
        d[1][val] = val % v[1];
    for( i64 i = 2;  i <= N;  ++i ) {
        for( i64 val = 0;  val <= VMAX;  ++val ) {
            d[i][val] = d[i - 1][val % v[i]] + 1LL * (i - 1) * (d[i - 1][val]);
            d[i][val] %= MOD;
        }
    }
    cout << d[N][start] << '\n';
    return 0;
}
