# -*- coding: utf-8 -*-
N, S = map(int, input().split())
A_list = list(map(int, input().split()))

dp = [[[] for i in range(N)] for _ in range(N)]
div_num = 998244353
ans = 0
for i in range(N - 1, -1, -1):
    for j in range(i, N):
        if i == j:
            if A_list[i] <= S:
                dp[i][j] = [A_list[i]]
                if A_list[i] == S:
                    ans += 1
        else:
            now_num = A_list[i]
            next_dp = dp[i + 1][j]
            temp_list = [now_num]
            temp_list.extend(next_dp)
            temp_list.extend([k + now_num for k in next_dp if k + now_num <= S])
            dp[i][j] = temp_list
            ans += temp_list.count(S)
            ans %= div_num
print(ans)            