#include <bits/stdc++.h>
using namespace std;
int dy[] = {1, -1, 0, 0, -1, 1, 1, -1};
int dx[] = {0, 0, 1, -1, 1, -1, 1, -1};
void file() {}
void fast() {
  std::ios_base::sync_with_stdio(0);
  cin.tie(NULL);
}
const int N = 3e3 + 9;
int mem[N][N], n, s, mod = 998244353;
vector<int> v1;
int solve(int idx, int sum) {
  if (idx == n) return 0;
  int& ret = mem[idx][sum];
  if (ret != -1) return ret;
  ret = solve(idx + 1, sum);
  long long ch = solve(idx + 1, sum + v1[idx]);
  if (sum + v1[idx] == s) ch = n - idx;
  ret += ch;
  ret %= mod;
  return ret;
}
int main() {
  fast();
  memset(mem, -1, sizeof mem);
  cin >> n >> s;
  v1 = vector<int>(n);
  for (auto& it : v1) cin >> it;
  int ans = 0;
  for (int i = 0; i < n; i++) {
    ans += solve(i, 0);
    ans %= mod;
  }
  cout << ans << "\n";
  return 0;
}
