#include <bits/stdc++.h>
using namespace std;
bool** dp;
long long n;
long long ans = 0;
void display(const vector<int>& v) {
  long long x = *min_element(v.begin(), v.end());
  long long y = *max_element(v.begin(), v.end());
  ans += (((x + 1) * (n - y)) % 998244353);
  ans %= 998244353;
}
void printSubsetsRec(vector<long long> 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(vector<long long> 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];
  if (dp[n - 1][sum] == false) {
    return;
  }
  vector<int> p;
  printSubsetsRec(arr, n - 1, sum, p);
}
void solve() {
  long long s;
  scanf("%lld %lld", &n, &s);
  vector<long long> arr(n);
  for (int i = 0; i < n; i++) scanf("%lld", &arr[i]);
  printAllSubsets(arr, n, s);
  cout << ans << endl;
}
int main() {
  long long t = 1;
  while (t--) {
    solve();
  }
  return 0;
}
