/*----------------by syr----------------*/
/*

         iii                  ii
     rBQBBBBBBE       BBR iBBBBQBBL     XBBBBBBQBBBBB
   iBBQJ    7BBB      BBsSBBr   BBQ      i      cBBB
  rBBU       iBBw     BBBQi     HBBi           KBBi
  BBH         BB5    iBBB       isL          wBB5
 GBB         iBBi    6BB                   iBBB
 BBQ         BQB     BBD                  QBBi
 BBB        BQB     iQBi                1BBv
 sBBg     wBBB      QBB               iBBB
  7BBBBBBBBBi       BBR              wBBBBBBBBBBBBB
     irvi           ii               ii    i i iii
                i5U
               BBB
               BB7
              1BB
      iPBBBBBKBBR    JBR1       rQBO   BR  UBQP  iBBQi
    7BBBGs7sXBBBi     QBBr     gBBE   rBB BB2BB7HBZQBB
   QBBi      sBQ       BBB   iBBB     SQBBR  BBBB  cBQ
  gBQ        BBg        BBB KBBi      MBBH   BBB   BBs
 iBBv       iBBi         QBBBL        BBR   pBB   iBB
 pBB        BBB         iBBBB        iBB    BBL   KBB
 MBB       BBBR        BBB JBBi      DBR   iBQ    BBL
 GBB     7BBBB2      PBBH   BBBi     BQr   DBB   iBB
  BQBXwgBBP BB7    1BBB      BBQ7   1BB    BBc   BBB
   2BBBBw   BB    EBBS        QBBi  HBa   iBB    BB7
*/
#include<bits/stdc++.h>

using namespace std;

#define PH push
#define MP make_pair
#define PB push_back
#define fst first
#define snd second
#define FOR(i, x, y) for(int i = (x); i < (y); ++i)
#define REP(i, x, y) for(int i = (x); i <= (y); ++i)
#define x0 x0123456789
#define y0 y0123456789
#define x1 x1234567890
#define y1 y1234567890
#define x2 x2345678901
#define y2 y2345678901
typedef double db;
typedef long long ll;
typedef long double ldb;
typedef unsigned long long ull;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;

const int INF = 1e9 + 7;
const int maxn = 205;
const int maxm = 1e5 + 5;

int n, x;
int a[maxn], dp[maxn][maxm];

/*
sort them in the increasing order
then for ai (after sorted), if it works,
it must be in front of all the elements that are smaller than it
otherwise it won't cause any influence
so we have dp(i, j) representing if you feed the first i elements with j,
what's the answer:
dp(i, j) = dp(i - 1, j mod a[i]) + dp(i - 1, j) * i
*/

int main(){
	scanf("%d%d", &n, &x);
	FOR(i, 0, n)
		scanf("%d", a + i);
	sort(a, a + n);
	FOR(i, 0, n) FOR(j, 0, maxm){
		if(!i){
			dp[i][j] = j % a[i];
			continue;
		}
		dp[i][j] = (dp[i - 1][j % a[i]] + 1ll * dp[i - 1][j] * i % INF) % INF;
	}
	printf("%d\n", dp[n - 1][x]);
	return 0;
}


#pragma GCC optimize("Ofast")
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>

#define F first
#define S second
#define int long long
#define ll long long
//#define int  unsigned long long
#define pb push_back
#define double long double

using namespace std;
using namespace __gnu_pbds;
typedef  tree< int , null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;
const int N = 35000;
const int K = 19;
int mod =  1e9 + 7;
int n, dp[210][100200], a[N], f[N], invf[N];
int solve(int m, int x){
    if (m > n) return dp[m][x] = x;
    if (dp[m][x] != 0) return dp[m][x];
    int cnt = 0;
    int l = m;
    while (l <= n && a[l] > x){
        cnt++;
        l++;
    }
    if (cnt != 0) return dp[m][x] = f[n - m + 1] * invf[n - m - cnt + 1] % mod * solve(m + cnt, x) % mod;
    int res = 0;
    for (int i = m; i <= n; i++){
        res = (res + f[n - m] * invf[n - i] % mod * solve(i + 1, x % a[i])) % mod;
    }
    return dp[m][x] = res;
}
int binpow(int x, int y){
    if (y == 0) return 1;
    if (y % 2) return x * binpow(x, y - 1) % mod;
    int z = binpow(x, y / 2);
    return z * z % mod;
}
main(){
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    //freopen("input.txt", "r", stdin);
    int x;
    cin >> n >> x;
    f[0] = 1;
    invf[0] = 1;
    for (int i = 1; i <= n; i++) f[i] = f[i - 1] * i % mod;
    for (int i = 1; i <= n; i++) invf[i] = binpow(f[i], mod - 2);
    for (int i = 1; i <= n; i++) cin >> a[i];
    sort(a + 1, a + n + 1);
    reverse(a + 1, a + n + 1);
    cout << solve(1, x);
}
