#include <bits/stdc++.h>
using namespace std;
bool** dp;
int ans = 0;
int n;
void display(const vector<int>& v) {
  ans = ans + (n - v[0]) * (v[v.size() - 1] + 1);
  ans = ((ans % 998244353) + 998244353) % 998244353;
}
void printSubsetsRec(int arr[], int i, int sum, vector<int>& p) {
  if (i == 0 && sum != 0 && dp[0][sum]) {
    p.push_back(i);
    display(p);
    return;
  }
  if (i == 0 && sum == 0) {
    display(p);
    return;
  }
  if (dp[i - 1][sum]) {
    vector<int> b = p;
    printSubsetsRec(arr, i - 1, sum, b);
  }
  if (sum >= arr[i] && dp[i - 1][sum - arr[i]]) {
    p.push_back(i);
    printSubsetsRec(arr, i - 1, sum - arr[i], p);
  }
}
void printAllSubsets(int arr[], int n, int sum) {
  if (n == 0 || sum < 0) return;
  dp = new bool*[n];
  for (int i = 0; i < n; ++i) {
    dp[i] = new bool[sum + 1];
    dp[i][0] = true;
  }
  if (arr[0] <= sum) dp[0][arr[0]] = true;
  for (int i = 1; i < n; ++i)
    for (int j = 0; j < sum + 1; ++j)
      dp[i][j] =
          (arr[i] <= j) ? dp[i - 1][j] || dp[i - 1][j - arr[i]] : dp[i - 1][j];
  vector<int> p;
  printSubsetsRec(arr, n - 1, sum, p);
}
int main() {
  int sum;
  cin >> n >> sum;
  int arr[n];
  for (int i = 0; i < n; i++) {
    cin >> arr[i];
  }
  printAllSubsets(arr, n, sum);
  cout << ans << "\n";
  return 0;
}
