n, s = map(int, input().split())
a = list(map(int, input().split()))

mod = 998244353

d = [[0 for _ in range(s+1)] for _ in range(n+1)]

def extGCD(a, b):
    if b == 0:
        return a, 1, 0
    g, y, x = extGCD(b, a%b)
    y -= a//b * x
    return g, x, y

def moddiv(a, b):
    _, inv, _ = extGCD(b, mod)
    return (a * inv) % mod

for i in range(n):
    if a[i] < s:
        d[i][a[i]] = (i + 1) * (n - i)
    for k in range(i):
        for j in reversed(range(s-a[i]+1)):
            p = (d[k][j] * (n-i)) % mod
            p = moddiv(p, (n-k))
            d[i][j + a[i]] += p
            d[i][j + a[i]] %= mod

ans = 0
for i in range(n):
    ans += d[i][s]
print(ans)