import Data.Int
import Data.List
import Data.Vector.Unboxed ((!))
import qualified Data.Vector.Unboxed as V

main = do
  [n,x] <- map read.words <$> getLine
  set <- sortBy (flip compare).map read.words <$> getLine
  print $ solve n x set

solve :: Int64 -> Int64 -> [Int64] -> Int64
solve n x = (*% fact n).(!fromIntegral x).go 1
  where
  go _ [] = V.fromListN 100001 [0..100000]
  go i (s:set) = V.generate 100001 f
    where
    f x' = let x = fromIntegral x' in (a!fromIntegral x *% (n-i) + a!fromIntegral (x`mod`s)) *% inv (n-i+1)
    a = go (i+1) set

infixl 7 *%
infixl 5 +%
infixl 5 -%
a *% b = a * b `mod` 1000000007
a -% b = (a - b) `mod` 1000000007
a +% b = (a + b) `mod` 1000000007
fact = foldl (*%) 1.enumFromTo 2
inv x = u where (u,_,_) = euc x 1000000007
euc = go 1 0 0 1
  where
  go u v u' v' x 0 = (u,v,x)
  go u v u' v' x y = go u' v' (u - q * u') (v - q * v') y r
    where (q,r) = quotRem x y

