#include <bits/stdc++.h>
using namespace std;
const int MOD = 998244353;
long long int a[3005];
long long int dp[3005][3005];
int main() {
  int n, s;
  scanf("%d%d", &n, &s);
  long long int ans = 0;
  for (int i = 0; i < n; i++) {
    scanf("%lld", &a[i]);
  }
  for (int start = 0; start < n; start++) {
    dp[start][0] = 1;
    for (int i = start; i < n; i++) {
      for (int j = s; j >= a[i]; j--) {
        if (dp[start][j - a[i]] > 0) {
          dp[start][j] += dp[start][j - a[i]];
          dp[start][j] %= MOD;
        }
      }
      ans += dp[start][s];
      ans %= MOD;
    }
  }
  printf("%lld\n", ans);
}
