#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, s;
  cin >> n >> s;
  vector<int> a(n);
  for (int i = 0; i < (n); i++) cin >> a[i];
  long long ans = 0;
  int l = 0, r = 0, sum = a[0];
  while (l < n) {
    if (sum == s) {
      ans += (l + 1) * (n - r) % 998244353;
      r++;
      sum += a[r];
    } else if (sum > s) {
      sum -= a[l];
      l++;
    } else {
      if (r == n - 1) break;
      r++;
      sum += a[r];
    }
  }
  cout << ans << "\n";
  return 0;
}
