#include<bits/stdc++.h>
using namespace std;
#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define all(x) x.begin(),x.end()
#define dbg(x) cout<<#x<<":"<<x<<endl
typedef long long ll;
typedef pair<ll,ll> P;
typedef pair<ll,P> PP;
ll dp[222][111111];
int main(){
  ll n,x,p=1e9+7;
  cin>>n>>x;
  vector<ll> s(n);
  for(int i=0;i<n;i++)cin>>s[i];
  
  sort(all(s));
  reverse(all(s));
  dp[0][x]=1;
  
  for(int i=0;i<n;i++){
    for(int j=0;j<=x;j++){
	 if(dp[i][j]==0)continue;
	 (dp[i+1][j%s[i]]+=dp[i][j])%=p;
	 (dp[i+1][j]+=dp[i][j]*(n-i-1)%p)%=p;
    }
  }
  ll ans=0;
  for(ll i=0;i<=x;i++){
    (ans+=i*dp[n][i]%p)%=p;
  }
  cout<<ans<<endl;
  return 0;
}
