#include <queue>
#include <stack>
#include <map>
#include <algorithm>
#include <math.h>
#include <stdio.h>
#include <string.h>
#include <vector>
#include <complex>
typedef long long int LL;
using namespace std;

// 插入此處

const int MOD = 998244353;

LL a[3005];
LL dp[3005][3005];

int main() {
    int n, s;
    scanf("%d%d", &n, &s);
    LL ans = 0;
    for (int i = 0; i < n; i++) {
        scanf("%lld", &a[i]);
    }
    for (int start = 0; start < n; start++) {
        dp[start][0] = 1;
        for (int i = start; i < n; i++) {
            for (int j = s; j >= a[i]; j--) {
                if (dp[start][j - a[i]] > 0) {
                    dp[start][j] += dp[start][j - a[i]];
                    dp[start][j] %= M;
                }
            }
            ans += dp[start][s];
            ans %= M;
        }
    }
    printf("%lld\n", ans);
}
