open System
open System.Collections.Generic

[<AutoOpen>]
module Cin =
    let read f = stdin.ReadLine() |> f
    let reada f = stdin.ReadLine().Split() |> Array.map f

    let readInts() =
        read string
        |> Seq.toArray
        |> Array.map (fun x -> Convert.ToInt32(x.ToString()))

module Util =
    let strRev (s: string): string =
        s
        |> Seq.rev
        |> Seq.map string
        |> String.concat ""

    let inline roundup (x: ^a) (y: ^a): ^a =
        let one = LanguagePrimitives.GenericOne
        (x + y - one) / y

[<RequireQualifiedAccess>]
module FastModInt =

    let inline init (x: ^a) (modulo: int64): int64 =
        let x = (int64 x) % modulo
        match x with
        | _ when x < 0L -> x + modulo
        | _ when x >= modulo -> x - modulo
        | _ -> x

    let inline add (lhs: ^a) (rhs: ^b) (modulo: int64) =
        let l = (int64 lhs) % modulo
        let r = (int64 rhs) % modulo
        init (l + r) modulo

    let inline sub (lhs: ^a) (rhs: ^b) (modulo: int64) =
        let l = (int64 lhs) % modulo
        let r = (int64 rhs) % modulo
        init (l - r) modulo

    let inline mul (lhs: ^a) (rhs: ^b) (modulo: int64) =
        let l = (int64 lhs) % modulo
        let r = (int64 rhs) % modulo
        init (l * r) modulo

    let inline inverse (a: ^a) (modulo: int64): int64 =
        let mutable (a, b, u, v) = (int64 a, modulo, 1L, 0L)
        while b > 0L do
            let t = a / b
            a <- a - (t * b)
            let tmp = a
            a <- b
            b <- tmp
            u <- u - (t * v)
            let tmp = u
            u <- v
            v <- tmp
        init u modulo

    let inline div (lhs: ^a) (rhs: ^b) (modulo: int64) =
        let l = (int64 lhs) % modulo
        let r = inverse rhs modulo
        init (l * r) modulo

    let inline pow (a: ^a) (n: ^b) (modulo: int64) =
        let mutable (res, a, n) = (1L, int64 a, int64 n)
        while n > 0L do
            if (n &&& 1L) = 1L then res <- res * a % modulo
            a <- a * a % modulo
            n <- n >>> 1
        res

[<EntryPoint>]
let main _ =
    let [|n;x|] = reada int
    let ss = reada int
    let modulo = (int64 1e9) + 7L

    let mutable dp = Array.init (x+1) (fun _ -> 0L)
    dp.[x] <- 1L
    for k in 0..n-1 do
        let m = ss.[k]
        let remain = n - 1 - k |> int64
        let newDP = Array.init (x+1) (fun _ -> 0L)
        for i in 0..x do
            newDP.[i%m] <- FastModInt.add newDP.[i%m] dp.[i] (modulo)
            let r = FastModInt.mul dp.[i] remain modulo
            newDP.[i] <- FastModInt.add newDP.[i] r modulo

        dp <- newDP

    let mutable ans = 0L
    for i in 0..x do
        let r = FastModInt.mul dp.[i] i modulo
        ans <- FastModInt.add ans r modulo

    ans
    |> printfn "%d"
    0 // return an integer exit code
