#include <bits/stdc++.h>
#pragma GCC optimize("O2")
using namespace std;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
inline long long add(long long a, long long b, long long m) {
  return (((a % m + b % m) % m + m) % m);
}
inline long long mul(long long a, long long b, long long m) {
  return (((a % m * b % m) % m + m) % m);
}
const double EPS = 1e-6;
const long long MOD = 998244353;
template <typename T, typename U>
ostream &operator<<(ostream &out, const pair<T, U> &p) {
  out << '[' << p.first << ", " << p.second << ']';
  return out;
}
template <template <typename, typename...> class ContainerType,
          typename ValueType, typename... Args>
void print_container(const ContainerType<ValueType, Args...> &c) {
  cout << "{ ";
  for (const auto &v : c) cout << v << ' ';
  cout << '}' << '\n';
}
long long dp[3005][3005];
long long go(long long i, long long s, vector<long long> &arr) {
  if (i >= (long long)(arr).size() && s != 0) return 0;
  if (s == 0) return ((long long)(arr).size() - i + 1);
  if (dp[i][s] != -1) return dp[i][s];
  return (dp[i][s] = go(i + 1, s - arr[i], arr) + go(i + 1, s, arr));
}
void solve() {
  long long n, s;
  cin >> n >> s;
  vector<long long> arr(n, 0);
  for (int i = 0; i < n; i++) cin >> arr[i];
  memset(dp, -1, sizeof(dp));
  long long ans = 0;
  for (int i = 0; i < n; i++) {
    long long temp = mul(i + 1, go(i + 1, s - arr[i], arr), MOD);
    ans = add(ans, temp, MOD);
  }
  cout << ans << '\n';
  return;
}
int main() {
  ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  clock_t start, stop;
  int t = 1;
  for (int tc = 1; tc < t + 1; tc++) solve();
  return 0;
}
