from collections import defaultdict

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

DP = [[defaultdict(int) for x in range(N)] for y in range(N)]

for i in range(N):
    DP[i][i][A[i]] = 1

for i in range(N):
    for j in range(i,N):
        for k,v in DP[i][j].items():
            for h in range(j+1,N):
                s = A[h] + k
                if A[h] + k > S:
                    continue
                DP[i][h][s] += v

s = 0
for i in range(N):
    for j in range(N):
        s += DP[i][j][S] * (i + 1) * (N - j)
        s %= 998244353

print(s)