N,S = map(int,input().split())
A = list(map(int,input().split()))
from collections import deque
import itertools
import numpy as np
ls = deque([])

A = np.array(A)
for v in itertools.product([0,1], repeat=N):
    u = np.array(v)
    if S == np.dot(A,u):
        u = list(u)
        i = N
        j = 0
        for k in range(N):
            if u[k] == 1:
                i = min(i,k)
                j = k
        ls.append([i,j])

ans = 0
MOD = 998244353

while ls:
    a = ls.pop()
    ans += (a[0]+1)*(N-a[1]) % MOD

print(ans)
