#include <bits/stdc++.h>
using namespace std;
const long long Mod = 998244353;
int n, s;
int a[3005];
int dp[3005];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> s;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
  }
  long long Res = 0;
  for (int i = 1; i <= n; i++) {
    for (int j = 0; j <= s; j++) {
      dp[j] = 0;
    }
    dp[a[i]] = dp[0] = 1;
    Res = (Res + dp[s]) % Mod;
    for (int j = i + 1; j <= n; j++) {
      for (int k = s; k >= a[j]; k--) {
        dp[k] = (dp[k] + dp[k - a[j]]) % Mod;
      }
      Res = (Res + dp[s]) % Mod;
    }
  }
  cout << Res;
  return 0;
}
