from collections import *
from heapq import *
from itertools import *
from fractions import gcd
import sys
from decimal import *
input=lambda :sys.stdin.readline().rstrip()

N,S=map(int,input().split())
A=list(map(int,input().split()))
mod=998244353


count=0


for z in range(N):
    dp=[defaultdict(int) for n in range(N-z)]
    idx={A[z]}
    dp[0][A[z]]+=1
    count+=dp[0][S]
    for n in range(1,N-z):
        nidx=set()
        for i in idx:
            b=i+A[n]
            if b<S+1:
                dp[n][b]+=dp[n-1][i]
                nidx.add(b)
            dp[n][i]+=dp[n-1][i]
        dp[n][A[n]]+=1
        idx.add(A[n])
        idx|=nidx
        count+=dp[n][S]
        count%=mod
    #print(dp)
print(count)
