description: You are given a binary string (i. e. a string consisting of characters 0 and/or 1) s of length n. You can perform the following operation with the string s at most once: choose a substring (a contiguous subsequence) of s having exactly k characters 1 in it, and shuffle it (reorder the characters in the substring as you wish).
  
  Calculate the number of different strings which can be obtained from s by performing this operation at most once.
  
  Input
  
  The first line contains two integers n and k (2 ≤ n ≤ 5000; 0 ≤ k ≤ n).
  
  The second line contains the string s of length n, consisting of characters 0 and/or 1.
  
  Output
  
  Print one integer — the number of different strings which can be obtained from s by performing the described operation at most once. Since the answer can be large, output it modulo 998244353.
  
  Examples
  
  Input
  
  
  7 2
  1100110
  
  
  Output
  
  
  16
  
  
  Input
  
  
  5 0
  10010
  
  
  Output
  
  
  1
  
  
  Input
  
  
  8 1
  10001000
  
  
  Output
  
  
  10
  
  
  Input
  
  
  10 8
  0010011000
  
  
  Output
  
  
  1
  
  Note
  
  Some strings you can obtain in the first example:
  
    * to obtain 0110110, you can take the substring from the 1-st character to the 4-th character, which is 1100, and reorder its characters to get 0110; 
    * to obtain 1111000, you can take the substring from the 3-rd character to the 7-th character, which is 00110, and reorder its characters to get 11000; 
    * to obtain 1100101, you can take the substring from the 5-th character to the 7-th character, which is 110, and reorder its characters to get 101. 
  
  
  
  In the second example, k = 0 so you can only choose the substrings consisting only of 0 characters. Reordering them doesn't change the string at all, so the only string you can obtain is 10010.
solution: #include <bits/stdc++.h>
  using namespace std;
  using namespace std;
  const double eps = 1e-6;
  const int int_inf = 2 * 1e9;
  const long long ll_inf = 8 * 1e18;
  const long double PI = acosl(-1.0);
  template <typename T>
  using pair2 = pair<T, T>;
  using pii = pair<int, int>;
  using pli = pair<long long, int>;
  using pll = pair<long long, long long>;
  istream& operator>>(istream& in, pii& i) {
    in >> i.first >> i.second;
    return in;
  }
  template <class T>
  istream& operator>>(istream& in, vector<T>& a) {
    for (auto& i : a) {
      in >> i;
    }
    return in;
  }
  template <class T>
  ostream& operator<<(ostream& out, vector<T>& a) {
    for (auto i : a) {
      out << i << " ";
    }
    out << '\n';
    return out;
  }
  mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());
  long long myRand(long long B) { return (unsigned long long)rng() % B; }
  long long powmod(long long a, long long b, long long p) {
    a %= p;
    if (a == 0) return 0;
    long long product = 1;
    while (b > 0) {
      if (b & 1) {
        product *= a;
        product %= p;
        --b;
      }
      a *= a;
      a %= p;
      b /= 2;
    }
    return product;
  }
  long long MOD = 998244353;
  long long factor[5007];
  long long invfactor[5007];
  long long inv(long long a, long long p) { return powmod(a, p - 2, p); }
  long long C(long long n, long long k) {
    return (((factor[n] * invfactor[k]) % MOD) * invfactor[n - k]) % MOD;
  }
  long long nCk(long long n, long long k, long long p) {
    return ((factor[n] * inv(factor[k], p) % p) * inv(factor[n - k], p)) % p;
  }
  void precalc() {
    factor[0] = 1;
    factor[1] = 1;
    invfactor[0] = 1;
    invfactor[1] = 1;
    for (int i = 2; i < 5007; ++i) {
      factor[i] = (factor[i - 1] * i) % MOD;
      invfactor[i] = inv(factor[i], MOD);
    }
  }
  void solve() {
    int n, k;
    string s;
    cin >> n >> k >> s;
    vector<int> prefs(n + 1, 0);
    for (int i = 1; i < n + 1; ++i) {
      prefs[i] = prefs[i - 1] + (s[i - 1] == '1');
    }
    if (prefs[n] < k) {
      cout << 1 << '\n';
      return;
    }
    long long ans = 1;
    for (int i = 0; i < n; ++i) {
      for (int j = i + 1; j < n; ++j) {
        int c1 = prefs[j + 1] - prefs[i];
        if (c1 > k) break;
        int c0 = j - i + 1 - c1;
        if (s[i] == '1') {
          c0--;
        } else {
          c1--;
        }
        if (s[j] == '1') {
          c0--;
        } else {
          c1--;
        }
        int len = c0 + c1;
        if (c0 >= 0 && c1 >= 0) ans = (ans + C(len, c1)) % MOD;
      }
    }
    cout << ans << '\n';
    return;
  }
  signed main() {
    ios_base::sync_with_stdio(false);
    std::cin.tie(0);
    std::cout.tie(0);
    precalc();
    int tt = 1;
    while (tt--) {
      solve();
    }
    return 0;
  }
  