#include <bits/stdc++.h>
using namespace std;
const long long logN = 20;
const long long M = 998244353;
const long long INF = 1e12;
const long long N = 3005;
long long dp[N][N];
long long A[N];
long long ans = 0;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long n, s;
  cin >> n >> s;
  for (long long i = 0; i < n; i++) cin >> A[i];
  long long ans = 0;
  for (long long i = 0; i < n; i++) {
    dp[i][0] = 1;
    for (long long j = i; j < n; j++) {
      for (long long k = s; k >= A[j]; k--) dp[i][k] += dp[i][k - A[j]];
      ans += dp[i][s];
    }
  }
  ans %= M;
  cout << ans << "\n";
  return 0;
}
