N, S = map(int, input().split())
nums = list(map(int, input().split()))

def dypr(nums, S):
    N = len(nums)
    dp = [[0 for i in range(S + 1)] for j in range(N + 1)]
    dp[0][0] = 1

    for i in range(N):
        for j in range(S + 1):
            if nums[i] <= j:
                dp[i + 1][j] = dp[i][j - nums[i]] + dp[i][j]
            else:
                dp[i + 1][j] = dp[i][j]
#    print(dp)
#    print(dp[N])
#    print(dp[N][S])
    return dp[N][S]

total = 0
for i in range(N):
    print("===")
    for j in range(i, N):
        total += dypr(nums[i: j + 1], S)
        #print(total)
print(total % 998244353)