#include <bits/stdc++.h>
using namespace std;
inline bool EQ(double a, double b) { return fabs(a - b) < 1e-9; }
template <typename T, typename U>
std::istream& operator>>(std::istream& i, pair<T, U>& p) {
  i >> p.x >> p.y;
  return i;
}
template <typename T>
std::istream& operator>>(std::istream& i, vector<T>& t) {
  for (auto& v : t) {
    i >> v;
  }
  return i;
}
template <typename T, typename U>
std::ostream& operator<<(std::ostream& o, const pair<T, U>& p) {
  o << p.x << ' ' << p.y;
  return o;
}
template <typename T>
std::ostream& operator<<(std::ostream& o, const vector<T>& t) {
  if (t.empty()) o << '\n';
  for (size_t i = 0; i < t.size(); ++i) {
    o << t[i] << " \n"[i == t.size() - 1];
  }
  return o;
}
template <typename T>
using minheap = priority_queue<T, vector<T>, greater<T>>;
template <typename T>
using maxheap = priority_queue<T, vector<T>, less<T>>;
template <typename T>
T gcd(T a, T b) {
  if (a < b) swap(a, b);
  return b ? gcd(b, a % b) : a;
}
long long n, m;
const int MOD = 998244353;
long long ways[3333];
void solve(istream& cin, ostream& cout) {
  int S;
  cin >> n >> S;
  vector<int> A(n);
  vector<long long> B;
  cin >> A;
  long long ans = 0;
  for (int L = 0; L < n; L++) {
    memset(ways, 0, sizeof(ways));
    ways[0] = 1;
    for (int i = L; i < n; i++) {
      for (int csum = S - A[i]; csum >= 0; csum--) {
        (ways[csum + A[i]] += ways[csum]) %= MOD;
      }
      (ans += ways[S]) %= MOD;
    }
  }
  cout << ans << endl;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.tie(nullptr);
  solve(cin, cout);
  return 0;
}
