from collections import *
from heapq import *
from itertools import *
from fractions import gcd
import sys
from decimal import *
input=lambda :sys.stdin.readline().rstrip()

N,S=map(int,input().split())
A=list(map(int,input().split()))
mod=998244353
dp=[defaultdict(int) for i in range(S+1)]
if A[0]<=S:
    dp[A[0]][0]+=1
count=0
for n in range(1,N):
    for i in range(len(dp)):
        b=i-A[n]
        if b>=0:
            for a in dp[b]:
                dp[i][a]+=a
    if A[n]<=S:
        dp[A[n]][n]+=1

    for i in dp[S]:
        count+=i+1
        count%=mod
print(count)
