N,S = map(int, input().split())
A = [int(x) for x in input().split()]

L = 0
R = 0
count = 0

while L < N:

    R = L+1
    wa = sum(A[L:R])

    while sum(A[L:R]) <= S:

        if sum(A[L:R]) == S:
            count += N-(R-L)+1
            break
        elif R < N+1:
            R += 1
        else:
            break

    L += 1

print(998244353%count)