#include <bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
bool isPrime(long long n) {
  if (n < 2) return 0;
  if (n < 4) return 1;
  if (n % 2 == 0 or n % 3 == 0) return 0;
  for (long long i = 5; i * i <= n; i += 6)
    if (n % i == 0 or n % (i + 2) == 0) return 0;
  return 1;
}
long long modexpo(long long x, long long p) {
  long long res = 1;
  x = x % 1000000007;
  while (p) {
    if (p % 2) res = res * x;
    p >>= 1;
    x = x * x % 1000000007;
    res %= 1000000007;
  }
  return res;
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long t = 1;
  while (t--) {
    long long n;
    cin >> n;
    long long s;
    cin >> s;
    long long a[n + 1];
    for (long long i = 1; i <= n; ++i) {
      cin >> a[i];
      a[i] += a[i - 1];
    }
    long long ans = 0;
    for (long long i = 1; i <= n; ++i) {
      for (long long j = 0; j < i; ++j) {
        if (a[i] - a[j] == s) ans = (ans + n - (i - j) + 1) % 998244353;
      }
    }
    cout << ans;
    cout << "\n";
  }
}
