import itertools

N,X = map(int, input().split())
S = [int(x) for x in input().split()]
New = list(itertools.permutations(S))

sum = 0
mod = 10 ** 9 + 7

for i in range(len(list(itertools.permutations(S)))):
    
    for j in range(N):
        alls = X % New[j][i]
        X = alls
    sum = sum + X


sum = sum % mod
print(sum)
    
    