n,s=map(int,input().split())
a=list(map(int,input().split()))
mod=998244353
ans=0
for l in range(n):
  dp=[[1]+[0]*3000 for _ in range(n+1)]
  for i in range(l,n):
    for j in range(3001):
        dp[i+1][j]=dp[i][j]
        if j-a[i]>=0:
            dp[i+1][j]+=dp[i][j-a[i]]
        dp[i+1][j]%=mod
    #print(dp[i+1][:10])
    ans+=dp[i+1][s]
    ans%=mod
print(ans)