#!/usr/bin/python3
import sys
from functools import lru_cache
sys.setrecursionlimit(10**6)
input = lambda: sys.stdin.readline().strip()
n, s = [int(x) for x in input().split()]
a = [0, *(int(x) for x in input().split())]
M = 998244353
@lru_cache(maxsize=None)
def count(i, s, forced=True):
    global n, a
    if s == 0:
        return i + 1
    elif i == 0:
        return 0
    else:
        return ((count(i - 1, s, False) if not forced else 0) + (count(i - 1, s - a[i], False) if a[i] <= s else 0)) % M

print(sum(count(i, s) * (n - i + 1) % M for i in range(1, n + 1)) % M)
