use std::io::{Read, StdinLock};
use std::iter::{FromIterator, Iterator};
use std::str::{FromStr};
use std::string::String;

macro_rules! debug {
    ($($a:expr),*) => {
        println!(concat!($(stringify!($a), " = {:?}, "),*), $($a),*);
    }
}

pub fn read_bytes<T: FromIterator<char>>(s: &mut StdinLock) -> T {
    s.bytes()
        .map(|c| c.unwrap() as char)
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect::<T>()
}

pub fn reads(s: &mut StdinLock) -> String {
    read_bytes::<String>(s)
}

pub fn read<T: FromStr>(s: &mut StdinLock) -> T {
    reads(s).parse().ok().unwrap()
}

//==============================================================================
//
// Problem specific code
//
//==============================================================================

const M: i64 = 998244353;

fn sum_f(n: usize, s: usize, ais: &Vec<usize>, l: usize) -> i64 {
    (l..n).fold((0, vec![0i64; s + 1]), |(tot, mut dp), i| {
        dp[0] = 1;  // 和 0 を作るのは空集合ただ1通りのみ
        let dp_ = (0..(s + 1)).map(|w| {
            if w < ais[i] { dp[w] } else { (dp[w - ais[i]] + dp[w]) % M }
        }).collect::<Vec<_>>();
        (tot + dp_[s], dp_)
    }).0
}

fn main() {
    let sin = std::io::stdin();
    let mut sin = sin.lock();

    let n: usize = read(&mut sin);
    let s: usize = read(&mut sin);
    let ais: Vec<usize> = (0..n).map(|_| read(&mut sin)).collect();

    let ans = (0..n).fold(0i64, |a, l| (a + sum_f(n, s, &ais, l)) % M);
    println!("{}", ans);
}