#include <bits/stdc++.h>
using namespace std;
#define REP(i,N) for(i=0;i<N;i++)
typedef long long ll;
typedef pair<int, int> P;
typedef struct{
  int first;
  int second;
  int third;
}T;

//昇順
bool comp_Se(T& l, T& r){
  return l.second < r.second;
}

ll mod =  1e9+7;
int main(void){
  int i,j,N,X;
  cin >> N >> X;
  vector<ll> v(N);
  REP(i,N) cin >> v[i];
  sort(v.begin(),v.end());

  //dp[i][j]:jをXの最初として，i+1回操作(ただしi+1番目まで)を行った時の総和
  ll dp[N][X+1];
  REP(j,X+1){
    dp[0][j] = j%v[0];
  }
  for(i=1;i<N;i++){
    REP(j,X+1){
      //dp[i-1][j%v[i]]:最初に行う場合
      //dp[i-1][j]*i 最初に行わない場合
      dp[i][j] = dp[i-1][j%v[i]] + dp[i-1][j] * i; 
      dp[i][j] %= mod;
    }
  }
  cout << dp[N-1][X] << endl;
  return 0;
}

#include <algorithm>  
#include <iostream>  
#include <sstream>  
#include <string>  
#include <cstring>
#include <vector>  
#include <queue>  
#include <set>  
#include <map>  
#include <cstdio>  
#include <cstdlib>  
#include <cctype>  
#include <cmath>  
#include <list>  
#include <cassert>
#include <ctime>
#include <climits>
using namespace std;

#define PB push_back  
#define MP make_pair  
#define SZ(v) ((int)(v).size())  
#define FOR(i,a,b) for(int i=(a);i<(b);++i)  
#define REP(i,n) FOR(i,0,n)  
#define FORE(i,a,b) for(int i=(a);i<=(b);++i)  
#define REPE(i,n) FORE(i,0,n)  
#define FORSZ(i,a,v) FOR(i,a,SZ(v))  
#define REPSZ(i,v) REP(i,SZ(v))  
typedef long long ll;
typedef unsigned long long ull;
ll gcd(ll a, ll b) { return b == 0 ? a : gcd(b, a%b); }

const int MAXN=200;
const int MAXX=100000;
const int MOD=1000000007;
void inc(int &a,int b) { if((a+=b)>=MOD) a-=MOD; }

int n,sx;
int a[MAXN];

int ways[MAXN+1][MAXX+1];


int solve() {
	sort(a,a+n); reverse(a,a+n);
	memset(ways,0,sizeof(ways)); ways[0][sx]=1;
	REP(i,n) REPE(x,sx) if(ways[i][x]!=0) {
		inc(ways[i+1][x],(ll)(n-i-1)*ways[i][x]%MOD);
		inc(ways[i+1][x%a[i]],ways[i][x]);
	}
	int ret=0; REPE(x,sx) inc(ret,(ll)x*ways[n][x]%MOD); return ret;
}

void run() {
	scanf("%d%d",&n,&sx);
	REP(i,n) scanf("%d",&a[i]);
	printf("%d\n",solve());
}

int main() {
	run();
	return 0;
}