N, S = map(int, input().split())
A = list(map(int, input().split()))
mod = 998244353
ans = 0
idx = []


def count(s, e):
    return (s + 1) * (N - e) % mod

from itertools import combinations

A = {i: j for i, j in enumerate(A)}
for k in range(1, N + 1):
    for l in map(dict, combinations(A.items(), k)):
        if sum(l.values()) == S:
            li = list(l.keys())
            ans = (ans + count(min(li), max(li))) % mod
                   
print(ans)