# coding: utf-8
import numpy as np
N, S = list(map(int, input().split()))
A = np.array(list(map(int, input().split())))

total = 0
comb = np.zeros(N)
comb_idx = 0

while comb_idx < 2**N:
  tmp = bin(comb_idx)[2:]
  comb[-len(tmp):] = np.array(list(map(int, list(tmp))))
  if np.dot(A, comb) == S:
    R = 1
    while True:
      if tmp[-R] == "1":
        break
      else:
        R += 1
    total += (N-len(tmp)+1) * R
    comb_idx += 1
  else:
    comb_idx += 1
print(total % 998244353)