#include <bits/stdc++.h>
using namespace std;
using ll = long long;
struct ProconInit {
  static constexpr int IOS_PREC = 15;
  static constexpr bool AUTOFLUSH = false;
  ProconInit() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(IOS_PREC);
    if (AUTOFLUSH) cout << unitbuf;
  }
} PROCON_INIT;
int vector_finder(std::vector<int> vec, int number) {
  auto itr = std::find(vec.begin(), vec.end(), number);
  size_t index = std::distance(vec.begin(), itr);
  if (index != vec.size()) {
    return 1;
  } else {
    return 0;
  }
}
ll gcd(ll a, ll b) {
  if (a < b) swap(a, b);
  if (a % b == 0) return b;
  return gcd(a % b, b);
}
ll lcm(ll a, ll b) { return a / gcd(a, b) * b; }
ll fact(ll n) {
  ll m;
  if (n == 0) {
    return 1;
  }
  m = fact(n - 1);
  return n * m;
}
ll Combination(unsigned long long n, unsigned long long r) {
  if (r * 2 > n) r = n - r;
  uintmax_t dividend = 1;
  uintmax_t divisor = 1;
  for (unsigned int i = 1; i <= r; ++i) {
    dividend *= (n - i + 1);
    divisor *= i;
  }
  return dividend / divisor;
}
struct vec {
  ll x, y;
  bool operator==(const vec& v) const { return x == v.x && y == v.y; }
};
namespace std {
template <>
class hash<vec> {
 public:
  size_t operator()(const vec& p) const { return p.x % SIZE_MAX; }
};
}  // namespace std
int main() {
  int N, S;
  cin >> N >> S;
  vector<int> A(N);
  for (ll(i) = (0); (i) < (N); (i++)) {
    int j;
    cin >> j;
    A[i] = j;
  }
  ll c = 0;
  ;
  ll sum = 0;
  for (ll(L) = (0); (L) < (N); (L++)) {
    for (ll(R) = (0); (R) < (N); (R++)) {
      for (ll(k) = (0); (k) < (R - L + 1); (k++)) {
        for (ll(l) = (k); (l) < (R - L + 1); (l++)) {
          sum += A[l];
          if (sum == S) {
            c++;
            sum = 0;
          }
        }
        sum = 0;
      }
    }
  }
  cout << c % 998244353 << endl;
  return 0;
}
