import sys
from functools import lru_cache
 
#read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10**6)
def read():
  return int(readline())
def reads():
  return map(int, readline().split())
def mp(arg):
  return map(int,arg.split())
n,s=reads()
a=list(reads())
mod= 998244353
@lru_cache(None)
def F(k):#ｆ１＋ｆ２＋．。。ｆｋ
  if k==1:
    res=[0]*(s+1)
    res[0]=1
    if a[0]<s+1:
      res[a[0]]=1
    return res
  res=F(k-1)
  #print(res)
  k-=1
  for i in range(s,-1,-1):
    if i-a[k]>=0:
      res[i]+=res[i-a[k]]
      if res[i]>=mod:
        res[i]-=mod
  if a[k]<s+1:
      res[a[k]]+=1
      if res[i]>=mod:
        res[i]-=mod
  res[0]+=1
  return res
ans=0
for i in range(1,n+1):
  ls=F(i)
  ans+=ls[-1]
print(ans)