from collections import Counter, defaultdict

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

MOD = 998244353

dp = dict()

for i in range(N):
    dp[(i, i)] = Counter([0])

ans = 0
for m in range(1, N + 1):
    for s in range(0, N + 1 - m):
        dp[(s, s + m)] = dp[(s, s + m - 1)].copy()
        for k, v in dp[(s, s + m - 1)].items():
            if k + A[s + m - 1] <= S:
                dp[(s, s + m)][k + A[s + m - 1]] =( v +  dp[(s, s + m)][k + A[s + m - 1]] )& MOD
        ans += dp[(s, s + m)][S]

ans %= MOD
print(ans)
pass
