# -*- 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:
            dp[i][j] = [A_list[i]]
            if A_list[i] == S:
                ans += 1
        else:
            dp[i][j] = dp[i][i][::]
            dp[i][j].extend(dp[i + 1][j])
            dp[i][j].extend([k + A_list[i] for k in dp[i + 1][j]])
            ans += dp[i][j].count(S)
            ans %= div_num
print(ans)            