#include <bits/stdc++.h>
using namespace std;
long long DIV = 1e9 + 7;
int N, S[int(2e5)];
long long dfs(int mod, int n) {
  long long mdn = mod % S[n];
  if (mod == 0 || mod == S[n])
    return 0;
  else if (n == 0)
    return mdn;
  else {
    long long sum = dfs(mdn, n - 1);
    int fac = n;
    for (int i = n - 1; i > 0; i--) {
      sum += dfs(mod % S[i], i - 1) * fac;
      fac *= i;
      if (sum > DIV) sum %= DIV;
    }
    sum += mod % S[0] * fac;
    return sum % DIV;
  }
}
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int X;
  cin >> N >> X;
  for (int n = 0; n < N; n++) cin >> S[n];
  sort(S, S + N);
  cout << dfs(X, N - 1) << "\n";
  return 0;
}
