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

DIVIDER = 998244353

import sys
sys.setrecursionlimit(50000)

def dp(pos, price, minL, maxR):
    global N
    global S
    global DIVIDER
    if pos == N:
        if price == S:
            # calc weight here
            if minL <= maxR:
                weight = 1
                weight = (weight * (minL + 1)) % DIVIDER
                weight = (weight * (N - maxR)) % DIVIDER
                return weight
            else:
                return 0 # unreachable
        else:
            return 0
    #
    ret = 0
    ret = (ret + dp(pos + 1, price, minL, maxR)) % DIVIDER
    if price == 0:
        ret = (ret + dp(pos + 1, price + A[pos], pos, pos)) % DIVIDER
    else:
        ret = (ret + dp(pos + 1, price + A[pos], minL, pos)) % DIVIDER
    #
    return ret

print(dp(0, 0, N, 0))