n,s=map(int,input().split())
a=list(map(int,input().split()))

dp=[[0]*(s+1) for _ in range(n+1)]
for i in range(n+1):
    dp[i][0]=1
ans=0

# i indicade low , c indicade column
for i,w in enumerate(a):
    for c in range(s+1):
        dp[i][c]+=dp[i-1][c]
    for c in range(s-w+1):
        dp[i][c+w]+=dp[i-1][c]
    ans+=dp[i][-1]
    ans%=998244353

print(ans)
