# not solved
# CPython: TLE
# PyPy: TLE

MOD_VAL = 998244353


def add_value(dp, n, k, v, target):
    if k + n <= target:
        if k + n in dp.keys():
            dp[k + n] += v
        else:
            dp[k + n] = v


def main():
    _, target = [int(v) for v in input().split(' ')]
    nums = [int(v) for v in input().split(' ')]
    dp = {0: 0, target: 0}
    ans = 0
    for n in nums:
        dp[0] += 1
        # tmp_dp = dp.copy()
        iters = list(dp.items())
        # for k, v in dp.items():
        for k, v in iters:
            if k + n <= target:
                # add_value(tmp_dp, n, k, v, target)
                add_value(dp, n, k, v, target)
        # dp = tmp_dp
        ans = (ans + dp[target]) % MOD_VAL
    print(int(ans))


if __name__ == '__main__':
    main()
