import numpy as np
from numpy.fft import rfft,irfft
import sys
sys.setrecursionlimit(10**9)

def mi(): return map(int,input().split())
def ii(): return int(input())
def isp(): return input().split()
def deb(text): print("-------\n{}\n-------".format(text))

INF=10**20
class Polynomial:
    def __init__(self,coefficient=None,dim=0,const=1):
        if coefficient == None:
            self.coefficient = np.zeros(dim+1, np.int64)
            self.coefficient[dim] = const
        else:
            self.coefficient = coefficient

    def __add__(self,other): # +
        f,g = self.coefficient, other.coefficient
        if len(f) > len(g): f,g = g,f

        h = Polynomial(dim=len(g)-1,const=0)
        h.coefficient[len(f):] += g[len(f):]
        h.coefficient[:len(f)] += f + g[:len(f)]
        return h
    
    def __iadd__(self,other): # +=
        h = self.__add__(other)
        self.coefficient = h.coefficient
        return self

    def __mul__(self,other): # *
        f = self.coefficient
        g = other.coefficient
        h = Polynomial()
        h.coefficient = self.fft(f,g)[:len(f)+len(g)-1]
        return h
    
    def __len__(self):
        return len(self.coefficient)

    def __getitem__(self,key):
        return self.coefficient[key]

    def get_coefficient(self,x):
        return self.coefficient[x]

    def mul_with_mod(self,other,MOD):
        f = self.coefficient
        g = other.coefficient
        h = Polynomial()
        h.coefficient = self.fft_with_mod(f,g,MOD)[:len(f)+len(g)-1]
        return h


    def fft(self,A,B,fft_len=1<<18):
        x = irfft(rfft(A,fft_len) * rfft(B,fft_len))
        return np.rint(x).astype(np.int64)

    def convolve(self,f,g):
        h = self.fft(f,g)[:len(f)+len(g)-1]
        return h

    def fft_with_mod(self,f,g,MOD,fft_len=1<<18):
        f1,f2 = np.divmod(f,1<<15)
        g1,g2 = np.divmod(g,1<<15)

        a = self.convolve(f1,g1) % MOD
        c = self.convolve(f2,g2) % MOD
        b = self.convolve(f1+f2,g1+g2)-(a+c)
        b %= MOD

        h = (a<<30)+(b<<15)+c
        return h % MOD



def main():
    N,S=mi()
    A=list(mi())
    MOD=998244353
 

    ans = 0
    F = Polynomial(const=0)
    for i in range(N):
        f = Polynomial(dim=A[i]) + Polynomial(const=1)
        F += Polynomial(const=1)

        F = F * f
        if S < len(F):
            F.coefficient[S] %= MOD
            ans += F[S] % MOD
    
    print(ans % MOD)
    


if __name__ == "__main__":
    main()