from collections import defaultdict
from functools import lru_cache

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

@lru_cache(maxsize=None)
def calc(i, j):
    dp = defaultdict(int)
    dp[0] = 1
    for a in A[i:j]:
        newDp = defaultdict(int)
        for s, c in dp.items():
            newDp[s] += c
            newDp[s + a] += c
        dp = newDp
    return dp[S]

ans = 0
MOD = 998244353
for left in range(N):
    for right in range(left + 1, N + 1):
        ans += calc(left, right)
print(ans % MOD)
