#include <bits/stdc++.h>
constexpr long long MOD = 1000000007;
constexpr long double PI = 3.14159265358979323846;
long long FACT(long long a) {
  if (a == 0)
    return 1;
  else
    return a * FACT(a - 1);
}
long long MODFACT(long long a, long long mod) {
  if (a == 0)
    return 1;
  else
    return (a * FACT(a - 1)) % mod;
}
long long nPr(long long n, long long r) {
  long long s = n - r + 1;
  long long sum = 1;
  for (long long i = s; i <= n; i++) sum *= i;
  return sum;
}
long long MODnPr(long long n, long long r, long long mod) {
  long long s = n - r + 1;
  long long sum = 1;
  for (long long i = s; i <= n; i++) {
    sum *= i;
    sum = sum % MOD;
  }
  return sum;
}
long long nCr2(long long n, long long r) {
  return FACT(n) / (FACT(r) * FACT(n - r));
}
long long GCD(long long a, long long b) {
  if (a < b) (a += b, b = a - b, a -= b);
  if (b == 0) return a;
  if (a % b == 0) return b;
  return GCD(b, a % b);
}
long long LCM(long long a, long long b) { return a * b / GCD(a, b); }
long long NUMOFDIV(long long n) {
  long long ans = 0;
  for (long long i = 1; i <= n; i++) {
    if (n % i == 0) ans++;
  }
  return ans;
}
long long CEIL1(long long n) { return (n + 9) / 10 * 10; }
long long DIGIT(long long n, long long k) {
  for (long long i = 0; i < k - 1; i++) n /= 10;
  return n % 10;
}
long long DIGITSUM(long long n) {
  long long sum = 0, dig;
  while (n) {
    dig = n % 10;
    sum += dig;
    n /= 10;
  }
  return sum;
}
long long DIVTIME(long long n, long long k) {
  long long div = 0;
  while (n % k == 0) {
    div++;
    n /= k;
  }
  return div;
}
long long MODPOW(long long a, long long n, long long mod) {
  long long ans = 1;
  while (n > 0) {
    if (n & 1) ans = ans * a % mod;
    a = a * a % mod;
    n >>= 1;
  }
  return ans;
}
long double LOG(long long a, long long b) { return log(b) / log(a); }
inline bool BETWEEN(long long x, long long min, long long max) {
  if (min <= x && x <= max)
    return true;
  else
    return false;
}
inline bool between(long long x, long long min, long long max) {
  if (min < x && x < max)
    return true;
  else
    return false;
}
inline bool PRIMEOR(long long x) {
  if (x == 1) return false;
  if (x == 2) return true;
  if (x % 2 == 0) return false;
  long double sqrtx = sqrt(x);
  for (long long i = 3; i <= sqrtx; i += 2) {
    if (x % i == 0) return false;
  }
  return true;
}
bool SQRTOR(long long n) {
  if (sqrt(n) == (long long)sqrt(n))
    return true;
  else
    return false;
}
using namespace std;
signed main() {
  long long N, S, ans = 0;
  cin >> N >> S;
  vector<long long> A(N);
  vector<long long> Sum(N);
  for (long long i = 0; i < N; i++) {
    cin >> A[i];
    if (i != 0)
      Sum[i] += Sum[i - 1] + A[i];
    else
      Sum[i] = A[i];
  }
  for (long long i = 1; i <= N; i++) {
    for (long long j = 0; j < N - i + 1; j++) {
      if (j == 0) {
        if (Sum[i - 1] == S) ans += N - i + 1;
      } else {
        if (Sum[j + i - 1] - Sum[j - 1] == S) ans += N - i + 1;
      }
    }
  }
  cout << ans % 998244353;
}
