#include<bits/stdc++.h>

#define ll long long
#define fornum(A,B,C) for(A=B;A<C;A++)
#define mp make_pair
#define pii pair<int,int>
#define pll pair<ll,ll>

using namespace std;

/////////////////////////////////////////////////////
#define MOD (ll)(1e9+7)
ll N,X;
ll dp[202][101010];
ll S[222];
ll i,j,k;
int main(){
    scanf("%lld%lld", &N ,& X);
    fornum(i,0,N){
        scanf("%lld", &S[i]);
    }
    sort(S, S + N, greater<ll>());
    dp[0][X] = 1;
    fornum(i,0,N){
        fornum(j,0,X+1){
            dp[i+1][j % S[i]] =(dp[i+1][j % S[i]] + dp[i][j])%MOD;
        }
        fornum(j,0,X+1){
            dp[i + 1][j] = (dp[i+1][j]+dp[i][j] * (N-1-i)) % MOD;
        }
    }
    ll ans = 0;
    fornum(i,0,S[N-1]){
        ans = (ans+dp[N][i] * i)%MOD;
    }
    printf("%lld", ans);
    return 0;
}