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