#include <iostream>
#include <vector>
#include <algorithm>
#include <utility>
#include <queue>
#include <string>
#include <set>
#include <bitset>
#include <unordered_map>

using namespace std;
using ll = long long;
using Pii = pair<int, int>;
using Pll = pair<ll, ll>;
template <class T>
using Vvec = vector<vector<T> >;

int main()
{
    const ll MOD = 1e9+7; 
    int N, X;
    cin >> N >> X;
    vector<ll> S(N);
    for(ll& x: S) cin >> x;
    sort(S.begin(), S.end());

    vector<ll> dp(X+1);
    for(int j=0; j<=X; j++) dp[j] = j % S[0];
    for(int i=1; i<N; i++){
        for(int j=X; j>=0; j--){
            dp[j] = dp[j%S[i]] + dp[j] * i;
            dp[j] %= MOD;
        }
    }
    cout << dp[X] << endl;
}