#include <bits/stdc++.h>
using namespace std;
int main() {
  long long N, S;
  cin >> N >> S;
  vector<vector<vector<long long>>> dp(
      N, vector<vector<long long>>(N, vector<long long>(S + 1, 0)));
  vector<long long> A(N, 0);
  for (long long i = 0; i < N; i++) {
    cin >> A[i];
    if (A[i] <= S) {
      dp[i][i][A[i]] = 1;
    }
  }
  for (long long i = 0; i < N; i++) {
    for (long long j = i; j < N; j++) {
      dp[i][j][0] = 1;
    }
  }
  for (long long i = 0; i < N; i++) {
    for (long long j = i + 1; j < N; j++) {
      for (long long p = 0; p <= S; p++) {
        if (p - A[j] >= 0) {
          dp[i][j][p] = (dp[i][j - 1][p] + dp[i][j - 1][p - A[j]]) % 998244353;
          ;
        } else {
          dp[i][j][p] = dp[i][j - 1][p];
        }
      }
    }
  }
  long long sum = 0;
  for (long long i = 0; i < N; i++) {
    for (long long j = i; j < N; j++) {
      sum += dp[i][j][S];
      sum = sum % 998244353;
      ;
    }
  }
  cout << sum << endl;
}
