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
const Mod = 998244353
let n,s = read()
var dp: array[0..3000,int]
var ct = 0
for _ in 1..n:
  let a = read()
  for i in s.countdown a: dp[i]=(dp[i]+dp[i-a])mod Mod
  dp[0]+=1; dp[a]+=1; ct+=dp[s]
echo ct mod Mod