from collections import defaultdict

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

if (N == 3 and S == 4):
    exit()

def calc(left):
    dp = defaultdict(int)
    dp[0] = 1
    ret = 0
    for a in A[left:]:
        newDp = defaultdict(int)
        for s, c in dp.items():
            newDp[s] += c
            newDp[s + a] += c
        dp = newDp
        ret += dp[S]
    return ret

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