import strutils, sequtils
let ip = stdin.readAll
var ii = 0
proc read:int {.inline.} =
  while ip[ii]>='0':
    result = result * 10 + (ip[ii].int - '0'.int); ii.inc
  ii.inc
const Mod = 998244353
let n, s = read()
var dp: array[0..3000,int]
var ct = 0
for _ in 1..n:
  let a = read()
  dp[s].inc
  for i in 0..s-a: dp[i]+=dp[i+a]; dp[i]+=Mod*int(dp[i]<0)
  ct+=dp[0]
echo ct mod Mod