#include <iostream>
#include <vector>
#include <algorithm>

using namespace std;

typedef long long ll;
const ll mod = 1e9 + 7;
int n,x;
ll dp[205][100005];
int s[205];
int mmin = mod;
int main() {
  cin >> n >> x;
  for(int i = 0; i < n; i++) {
    cin >> s[i];
    mmin = min(mmin,s[i]);
  }
  sort(s,s+n);
 

  dp[n][x] = 1;
  int k = x;
  for(int i = n; i > 0; i--) {
    for(int j = 0; j <= x; j++) {
      if(dp[i][j] == 0) continue;
      dp[i-1][j] = (dp[i-1][j] + dp[i][j] * (i - 1)) % mod;
    dp[i-1][j % s[i-1]] += dp[i][j];
    }
  }

  ll ans = 0;
  for(int i = 0; i < mmin; i++) {
    //   cout << "d[0]["<<i<<"] = "<<dp[0][i] << endl;
    ans = (ans + (dp[0][i] * i) % mod ) % mod;
  }
  cout << ans << endl;
}
