from itertools import combinations

n, s = map(int, input().split())
a = list(map(int, input().split()))
selections = []
for i in range(1, n + 1):
    for selection in combinations(range(n), i):
        if sum([a[j] for j in selection]) == s:
            selections.append(list(selection))

ans = 0
for selection in selections:
    ans += (selection[0] + 1) * (n - selection[-1])
print(ans % 998244353)