n,s = map(int,input().split())
a = list(map(int,input().split()))
mod = 998244353

cnt = 0
for l in range(n):
  for r in range(l,n):
    a2 = a[l:r+1]
    for i in range(2**len(a2)):
      t = 0
      for j in range(len(a2)):
        if ((i >> j) & 1):
          t += a2[j]
      if t == s:
        cnt += 1

print(cnt % mod)