#include <bits/stdc++.h>
using namespace std;
int dp[3005][3005];
const int INF = 998244353;
long long a[3005], N, S, sum = 0;
void DP() {
  for (int i = 0; i < N; i++) {
    dp[i][0] = 1;
    if (a[i] <= S) {
      for (int j = 0; j <= i; j++) {
        for (int k = S; k >= a[i]; k--) {
          dp[j][k] += dp[j][k - a[i]];
          if (k == S) {
            sum = (sum + dp[j][k]) % INF;
          }
        }
      }
    } else
      continue;
  }
  cout << sum;
}
int main() {
  cin >> N >> S;
  memset(dp, 0, sizeof(dp));
  for (int i = 0; i < N; i++) {
    cin >> a[i];
  }
  DP();
}
