import sys
sys.setrecursionlimit(20000000)
input = sys.stdin.readline
n,x = map(int,input().split())
s = list(map(int,input().split()))
mod = 10**9 + 7
s.sort()
s = s[::-1]
c = max(max(s),x)
dp = [[0]*(c+1) for i in range(n+1)]
dp[0][x] = 1
for i in range(n):
    for j in range(c+1):
        dp[i+1][j%s[i]] += dp[i][j]
        dp[i+1][j%s[i]] %= mod
        dp[i+1][j] += dp[i][j]*(n-i-1)
        dp[i+1][j] %= mod
ans = 0
for i in range(c+1):
        ans += dp[n][i]*i
        ans %= mod
print(ans)
if n <= 10000:
  print(9)