let [|N;S|] =
    stdin.ReadLine().Split()
    |> Array.map int
let A =
    stdin.ReadLine().Split()
    |> Array.map int
let Mod = 998244353

let initialArray = Array.create (S+1) 0
Array.set initialArray 0 1
let folder (state:int[],commited: int[]) item =
    let newState =
        state
        |> Array.mapi (fun i value ->
            if i - item < 0 then value
            else (value + state.[i-item]) % Mod)
    let newCommited =
        commited
        |> Array.mapi (fun i value -> (value + newState.[i]) % Mod)
    Array.set newState 0 ((newState.[0]+1) % Mod)
    (newState, newCommited)

Array.scan folder (initialArray,initialArray) A
|> (fun arr -> arr.[N])
|> (fun (_,x) -> x.[S])
|> stdout.WriteLine