function main()
  N,S=map(x->parse(Int,x),split(readline()))
  dp=zeros(Int,S+1)
  ans=0
  const mod=998244353
  for a=map(x->parse(Int,x),split(readline()))
    dp[1]+=1
    for i=S-a:-1:0
      dp[i+1]+=dp[i+a+1]
      if dp[i+1]>=mod
        dp[i+1]-=mod
      end
    end
    ans+=dp[S+1]
  end
  println(ans%mod)
end
main()