from itertools import combinations_with_replacement

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


def part_sum(A):
    p = 998244353
    n = len(A)
    # 初期化
    dp = [[0 for _ in range(S + 1)] for _ in range(N + 1)]
    dp[0][0] = 1

    # DP
    for i in range((len(A))):
        for j in range(S + 1):
            if A[i] <= j:
                dp[i + 1][j] = dp[i][j - A[i]] + dp[i][j] % p
            else:  
                dp[i + 1][j] = dp[i][j] % p

    return dp[n][S]


s = 0
for p, q in combinations_with_replacement(range(N), 2):
    if p == q:
        s += part_sum([AA[p]])
    else:
        s += part_sum(AA[p:q + 1])

print(s % 998244353)
