import sys
input = sys.stdin.readline
N,S =(int(x) for x in  input().split())
As=[int(x) for x in input().split()]
import itertools 
LRs=list(itertools.combinations_with_replacement(range(N),2))
combinations = itertools.combinations
res=0
for i in LRs:
    if i[1]==N-1:
        if i[0]==0:
            LR=As[:]
        else:
            LR=As[i[0]:]
    else:
        if i[0]==0:
            LR=As[:i[1]+1]
        else:
            LR=As[i[0]:i[1]+1]
    for x in range(len(LR)):
        xs=[1 for y in list(combinations(LR,x+1)) if sum(y)==S]
        res+=len(xs)
print(res%998244353)