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