import java.io._
import java.util.StringTokenizer
import scala.util.control.Breaks.{breakable,break}

object Main extends App {
  val in = new InputReader(System.in)
  val pw = new PrintWriter(System.out)

  val MOD = 1e9.toLong + 7

  def repeatSquares(x: Long, n: Long): Int = {
    n match{
      case 0 => 1
      case _ =>
        n % 2 == 0 match{
          case true  => repeatSquares(x*x % MOD, n/2)
          case false =>
            ((x * repeatSquares(x*x % MOD, n/2).toLong) % MOD).toInt
        }
    }
  }

  val N = in.next().toInt
  val X = in.next().toInt
  val _S = new Array[Int](N)

  for (i <- 0 until N)
    _S(i) = in.next().toInt


  //
  val S = 0 +: _S.sorted.reverse
  val dp = Array.ofDim[Long](N+1, X+1)
  for (n <- 0 to N; x <- 0 to X)
    dp(n)(x) = -1L

  def calc(i: Int, X: Int): Long = {
    if(i == N)
      X % S(i)
    else if(dp(i)(X) != -1L)
      dp(i)(X)
    else {
      val denom = repeatSquares(N+1-i, MOD-2) % MOD
      val r1 = (denom * calc(i+1, X % S(i))) % MOD
      val r2 = ((N-i) * denom % MOD) * calc(i+1, X) % MOD
      dp(i)(X) = (r1 + r2) % MOD
      dp(i)(X)      
    }
  }

  def fact(n: Long, acc: Long): Long =
    if(n == 1)
      acc
    else
      fact(n-1, (n*acc) % MOD)

  val expected = calc(1, X) % MOD
  val ans = expected * fact(N, 1L)
  println(ans % MOD)
}


class InputReader(stream: InputStream) {
  private val reader = new BufferedReader(new InputStreamReader(stream))
  private var tokenizer: StringTokenizer = new StringTokenizer(reader.readLine())
  def next(): String = {
    while (!tokenizer.hasMoreTokens()) {
      tokenizer = new StringTokenizer(reader.readLine())
    }
    tokenizer.nextToken()
  }
}

