n,x = gets.split.map(&:to_i)
s = gets.split.map(&:to_i).permutation(n).to_a

result = 0
s.map do |arr|
  num = x
  for i in 0..arr.size-1 do
    num = num % arr[i]
  end
  result += num
end

puts (result % ( 10**9 + 7 ) )
