// I SELL YOU...! 
#include<iostream>
#include<vector>
#include<algorithm>
#include<functional>
#include<queue>
#include<chrono>
#include<iomanip>
#include<map>
#include<set>
using namespace std;
using ll = long long;
using P = pair<ll,ll>;
void init_io(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  cout << setprecision(10);
}
#define MOD 1000000007
#define MAX 110000
ll dp[220][MAX]={};
signed main(){
  init_io();
  ll n,x,ans=0;
  cin >> n >> x;
  vector<ll> s(n);
  for(int i=0;i<n;i++){
    cin >> s[i];
  }
  sort(s.begin(),s.end());
  for(int i=0;i<=x;i++){
    dp[0][i] = i;
  }
  for(int i=0;i<n;i++){
    for(int j=0;j<=x;j++){
      dp[i+1][j] += dp[i][j%s[i]];
      dp[i+1][j] %= MOD;
      dp[i+1][j] += dp[i][j] * i;
      dp[i+1][j] %= MOD;
    }
  }
  cout << dp[n][x]<<endl;
}
