import numpy as np

n, s = map(int, input().split())
A = list(map(int, input().split()))
MOD = 998244353

U = 3010
count = 0
F = np.zeros(U + 1, np.int64)
for a in A:
    F[0] += 1
    # python 3.4 ではだめみたい
    # FF = F
    # FF[a:] += FF[:-a]
    # FF %= MOD
    # F = FF
    F[a:] += F[:-a].copy()
    F %= MOD # forgot
    count += F[s]
    print(F[0:10])

count %= MOD
print(count)