#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  ;
  int n, s;
  cin >> n >> s;
  vector<int> v(n + 1);
  for (int i = 1; i <= n; i++) cin >> v[i];
  int dp[s + 1][n + 1];
  for (int sum = 1; sum <= s; sum++) {
    for (int i = 1; i <= n; i++) {
      if (v[i] > sum)
        dp[sum][i] = 0;
      else if (v[i] == sum)
        dp[sum][i] = i;
      else {
        int temp = 0;
        for (int j = 1; j < i; j++)
          temp = (temp * 1LL + dp[sum - v[i]][j]) % 998244353;
        dp[sum][i] = temp;
      }
    }
  }
  int ans = 0;
  for (int i = 1; i <= n; i++)
    ans = (ans + (dp[s][i] * 1LL * (n - i + 1)) % 998244353) % 998244353;
  cout << ans << endl;
}
