# fp = open("input/21")
# input = fp.readline
n,s = [int(c) for c in input().split()]
a = [int(c) for c in input().split()]
# t[i][j] : 0<=r<...,<l=iについて和がsになるようなf(r,l)の和
t = [[0]*(s+1) for _ in range(n)]
if a[0]<=s:
    t[0][a[0]] = 1
for i in range(n):
    t[i][0] = i+2
for i in range(1,n):
    for j in range(1,s+1):
        tt = t[i-1][j]
        if j-a[i]>=0:
            tt += t[i-1][j-a[i]]
        t[i][j] = tt
print(sum(t[i][s] for i in range(n))%998244353)