import numpy as np
n,s=map(int,input().split())
a=list(map(int,input().split()))
mod=998244353
ans=0
for l in range(n):
  dp=np.zeros(3001,np.int64)
  dp[0]=1
  for i in range(l,n):
    dp[a[i]:]+=dp[:-a[i]]
    dp%=mod
    ans+=dp[s]
    ans%=mod
print(ans)