#include <bits/stdc++.h>
using namespace std;
using i64 = long long;
const i64 MOD = 998244353;
int main() {
  i64 N, S;
  cin >> N >> S;
  vector<i64> A(N);
  for (i64 i = 0; i < N; i++) cin >> A[i];
  i64 ans = 0;
  for (i64 i = 0; i < N; i++) {
    vector<i64> dp(S + 1);
    dp[0] = 1;
    for (i64 j = i; j < N; j++) {
      for (i64 k = S - A[j]; 0 <= k; k--) (dp[k + A[j]] += dp[k]) %= MOD;
      (ans += dp[S]) %= MOD;
    }
  }
  cout << ans << "\n";
  return 0;
}
