#include<bits/stdc++.h>
#define st first
#define nd second
#define pb push_back
#define pf push_front
#define ppb pop_back
#define ppf pop_front
#define umax(x,y) x=max(x,y)
#define umin(x,y) x=min(x,y)
#define ll long long 
#define ii pair<int,int>
#define iii pair<int,ii>
#define iiii pair<ii,ii>
#define sz(x) ((int) x.size())
#define orta ((bas+son)/2)
#define all(x) x.begin(),x.end()
#define pw(x) (1<<(x))
#define inf 1000000005
#define MOD 1000000007 
#define N 100005
#define M 1000003
#define LOG 19
#define KOK 250
#define EPS 0.0000001
using namespace std;

int n,x;
int s[N],dp[N],pt[N];
int res[205][205];

int mul(int x,int y) {
	
	return (ll)x*y%MOD;

}

int add(int x,int y) {

	x+=y;

	if(x>=MOD) x-=MOD;
	if(x<0) x+=MOD;

	return x;

}

int main() {

	scanf("%d %d",&n,&x);

	for(int i=1;i<=n;i++) scanf("%d",&s[i]);

	sort(s+1,s+1+n);

	for(int i=0;i<=n+1;i++) {

		res[i][0]=1;

		for(int j=1;j<=n+1;j++) {

			res[i][j]=mul(res[i][j-1],i+j-1);

		}

	}

	int ptr=0;

	for(int i=0;i<=x;i++) {

		while(s[ptr+1]<=i && ptr+1<=n) ++ptr;

		pt[i]=ptr;

		if(ptr==0) dp[i]=i;

		for(int j=ptr;j>=1;j--) {

			int nm=i%s[j];

			dp[i]=add(dp[i],mul(dp[nm],res[pt[nm]+1][ptr-pt[nm]-1]));

		}

	}

	dp[x]=mul(dp[x],res[ptr+1][n-ptr]);

	printf("%d",dp[x]);

}

#include <bits/stdc++.h>

template <typename InputIterator>
typename InputIterator::value_type summation(InputIterator first,
                                             InputIterator last) {
  using T = typename InputIterator::value_type;
  T *p = new T();
  const auto sum = std::accumulate(first, last, *p);
  delete p;
  return sum;
}
template <typename T>
std::istream &operator>>(std::istream &stream, std::vector<T> &v);
template <typename T1, typename T2>
std::istream &operator>>(std::istream &stream, std::pair<T1, T2> &p);
template <typename T>
std::istream &operator>>(std::istream &stream, std::vector<T> &v) {
  for (auto &i : v) {
    stream >> i;
  }
  return stream;
}
template <typename T1, typename T2>
std::istream &operator>>(std::istream &stream, std::pair<T1, T2> &p) {
  stream >> p.first >> p.second;
  return stream;
}

int main() {
  int64_t n, x;
  std::cin >> n >> x;
  std::vector<int64_t> s(n);
  std::cin >> s;
  std::sort(s.begin(), s.end(), std::greater<int64_t>());

  constexpr int64_t mod = 1000000007;

  std::vector<int64_t> t1(100001, 0), t2(100001, 0);

  t1[x] = 1;

  for (int64_t i = 0; i < n; i++) {
    std::fill(t2.begin(), t2.end(), 0);
    for (int64_t j = 0; j < 100001; j++) {
      t2[j % s[i]] += t1[j] % mod;
      t2[j % s[i]] %= mod;
      t2[j] += t1[j] * (n - i - 1);
      t2[j] %= mod;
    }
    std::swap(t1, t2);
  }

  int64_t ans = 0;

  for (int64_t j = 0; j < 100001; j++) {
    ans += j * t1[j] % mod;
    ans %= mod;
  }

  std::cout << ans << std::endl;

  return 0;
}