inputs = (gets).split(" ")
$nn = inputs[0].to_i
xx = inputs[1].to_i

inputs = (gets).split(" ")
$si = inputs.map{|istr| istr.to_i}
$si.sort!
$minv = $si.min

$total = 0

$fact_memo = Array.new(200){0}
def fact(n)
  if (n <= 0) then
      n = 0
  end
  if ($fact_memo[n] > 0) then
      return $fact_memo[n]
  end
  r = n
  (n-1).downto(1) do |a|
    r = r*a
  end
  if (r<=0) then
      r = 1
  end
  $fact_memo[n] = r
  return r
end
#puts fact(3)

$mod_memo = []
def add_memo(x, vec, out)
    v2 = vec.select{|v| v < x}
    #p [x, v2, out]
    $mod_memo.push([x, v2, out])
end
def search_memo(x, vec)
    v2 = vec.select{|v| v < x}
    kv = [x, v2]
    #p kv
    $mod_memo.each do |memo|
        #p memo[0..1]
        if (memo[0..1] == kv) then
            return memo[2]
        end
    end
    return -1
end

def mod_ope(b, head)
  memo = 0
  ($nn-head).times do |n|
    mo = b.modulo($si2[0])
    mo = 0 if mo==$minv
    #puts "#{head}: #{$si2[0]} => #{mo}"
    #p $si2
    if mo < $minv then
        t = mo*fact($nn-head-1)
        $total = $total + t
        memo = memo + t
        #puts "  #{$si2[0]} [a] #{mo} * #{fact($nn-head-1)}"
    elsif ( (me = search_memo(mo, $si2)) >= 0 ) then
        t = me*fact($nn-head-1)
        $total = $total + t
        memo = memo + t
        #puts "  #{$si2[0]} [b] #{me} * #{fact($nn-head-1)}"
    else
        #puts "---- #{$si2[0]} @ #{head} / #{mo}"
        buf = $si2.dup
        $si2 = $si2[1..($nn-1-head)]
        #p $si2
        t = mod_ope(mo, head+1)
        memo = memo + t
        $si2 = buf
        add_memo(mo, $si2, t)
        #puts "---"
    end
    #puts "----"
    #p $si2
    $si2.rotate!(1)
  end
  return memo
end

$si2 = $si.dup
#p $si2
mod_ope(xx, 0)

puts $total.modulo(1000000000+7)