
n, s = (int(x) for x in input().split())
arr = [int(x) for x in input().split()]

MOD = 998244353

def knabsack(arr):
    n = len(arr)
    smax = sum(arr)
    if s > smax:
        return 0
    dp = [[0 for _ in range(smax+1)] for _ in range(n+1)]
    dp[-1][0] = 1
    sol = 0
    for i in range(n):
        for ss in range(smax+1):
            dp[i][ss] = (dp[i-1][ss] + (dp[i-1][ss-arr[i]] if ss-arr[i] >= 0 else 0)) % MOD
        sol = (sol + dp[i][s]) % MOD
    return sol

sol = 0
for i in range(n):
    sol = (sol + knabsack(arr[i:]))%MOD

print(sol)
