#include<bits/stdc++.h>
using namespace std;
typedef long long ll;

ll dp[202][100010];

signed main(){
    ios::sync_with_stdio(false);
	cin.tie(0);
    cout << fixed << setprecision(20);

    ll n,x;
    cin>>n>>x;
    ll a[n];
    for(int i=0;i<n;i++){
        cin>>a[i];
    }
    ll mod = 1e9+7;
    dp[0][x]=1;
    sort(a,a+n,greater<ll>());

    for(int i=0;i<n;i++){
        for(int j=0;j<=x;j++){
            dp[i+1][j%a[i]] += dp[i][j];
            dp[i+1][j%a[i]] %= mod;
            dp[i + 1][j] += dp[i][j] * (n - i - 1); dp[i + 1][j] %= mod;
        }
    }
    ll ans = 0;
    for(ll i=0;i<=x;i++){
        ans += i*dp[n][i];
        ans %= mod;
        //cerr<<i<<" "<<ans<<endl;
    }
    cout<<ans<<endl;
}