import collections

n,s = map(int,raw_input().split(' '))
ar = map(int, raw_input().split(' '))
def f(a,s): 
	count = 0
	for l in range(0, len(a)):
		dp = collections.defaultdict(int)
		dp[0] = 1
		for r in range(l, len(a)):
			for k in range(s)[::-1]:
				dp[k+a[r]] += dp[k]

			count += dp[s]
			count %= 998244353
	return count

print f(ar,s)



