use std::io::Read;

fn run() {
    let mut s = String::new();
    std::io::stdin().read_to_string(&mut s).unwrap();
    let mut it = s.trim().split_whitespace();
    let _n: usize = it.next().unwrap().parse().unwrap();
    let w: usize = it.next().unwrap().parse().unwrap();
    let a: Vec<usize> = it.map(|s| s.parse().unwrap()).collect();
    const MOD: u64 = 998_244_353;
    let mut ans = 0u64;
    let mut dp = vec![0u64; w + 1];
    for a in a.chunks(34) {
        for &a in a.iter() {
            dp[0] += 1;
            if a <= w {
                unsafe {
                    let mut x = dp.as_mut_ptr().add(w);
                    let mut y = dp.as_mut_ptr().add(w - a);
                    for _ in a..(w + 1) {
                        *x += *y;
                        x = x.sub(1);
                        y = y.sub(1);
                    }
                }
            }
            ans = (ans + dp[w]) % MOD;
        }
        for v in dp.iter_mut() {
            *v %= MOD;
        }
    }
    println!("{}", ans);
}

fn main() {
    run();
}
