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: import java.io.BufferedReader;
  import java.io.BufferedWriter;
  import java.io.IOException;
  import java.io.InputStreamReader;
  import java.io.OutputStreamWriter;
  import java.util.*;
  import java.util.stream.Stream;
  
  public class Program {
  
      static BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
      static BufferedWriter out = new BufferedWriter(new OutputStreamWriter(System.out));
  
      public static void main(String[] args) throws NumberFormatException, IOException {
  
  //        int cases = Integer.parseInt(reader.readLine());
          int cases = 1;
          int mod = 998244353;
  
          long[] fact = factorial(10000, mod);
          long[] invfact = invfactorial(10000, mod, fact);
  
          while(cases-- > 0) {
  
              String[] firstLine = reader.readLine().split(" ");
  
              int n = Integer.parseInt(firstLine[0]);
              int k = Integer.parseInt(firstLine[1]);
  
              String str = reader.readLine();
  
              int[] arr = new int[n];
              int sum = 0;
  
              for(int i=0;i<arr.length;i++) {
                  arr[i] = str.charAt(i)-'0';
                  sum += arr[i];
              }
  
              if(sum < k || k==0) {
                  printNumber(1);
                  continue;
              }
  
              long ans = 0;
              int count = 0;
              int st = 0;
              int en = 0;
              for(int i=0;i<arr.length;i++) {
                  if(arr[i] == 1) {
                      count++;
                  }
                  if(count>k) {
                      break;
                  }
                  en = i;
              }
  
              ans += ncr(en-st+1, k, mod, fact, invfact);
  
              for(int j=en+1;j<arr.length;j++) {
  
                  if(arr[j]==0) {
                      ans += ncr(j-st, k-1, mod, fact, invfact);
                  }else {
                      while(arr[st] == 0) st++;
                      st++;
                      ans += ncr(j-st, k, mod, fact, invfact);
                  }
  
                  ans%=mod;
  
              }
  
              printNumber(ans);
  
  
          }
  
          out.flush();
  
      }
  
       public static int ub(long[] arr, long num) {
          int start = 0;
          int end = arr.length;
          int mid = 0;
  
          while(start<end) {
              mid = start + (end-start)/2;
              if(arr[mid] < num) {
                  start = mid+1;
              }else {
                  end = mid;
              }
          }
          return start;
       }
  
      public static int[] convertToIntPrimitiveArray() throws IOException {
          String[] str = reader.readLine().split(" ");
          return Stream.of(str).mapToInt(Integer::parseInt).toArray();
      }
  
      public static Integer[] convertToIntArray(String[] str) {
          Integer[] arr = new Integer[str.length];
          for(int i=0;i<str.length;i++) {
              arr[i] = Integer.parseInt(str[i]);
          }
          return arr;
      }
  
      public static Long[] convertToLongArray(String[] str) {
          Long[] arr = new Long[str.length];
          for(int i=0;i<str.length;i++) {
              arr[i] = Long.parseLong(str[i]);
          }
          return arr;
      }
  
      public static long[] convertToLongPrimitiveArray() throws IOException {
          String[] str = reader.readLine().split(" ");
          return Stream.of(str).mapToLong(Long::parseLong).toArray();
      }
  
      public static void printYes() throws IOException {
          out.append("YES" + "\n");
      }
  
      public static void printNo() throws IOException {
          out.append("NO" + "\n");
      }
  
      public static void printNumber(long num) throws IOException {
          out.append(num + "\n");
      }
  
      public static long hcf(long a, long b) {
          if(b==0) return a;
          return hcf(b, a%b);
      }
  
      public static int findSet(int[] parent, int[] rank, int v) {
          if(v==parent[v]) {
              return v;
          }
          parent[v] = findSet(parent, rank, parent[v]);
          return parent[v];
      }
  
      public static void unionSet(int[] parent, int[] rank, int a, int b) {
  
          a = findSet(parent, rank, a);
          b = findSet(parent, rank, b);
  
          if(a == b) {
              return;
          }
  
          if(rank[a] < rank[b]) {
              int temp = a;
              a = b;
              b = temp;
          }
  
          parent[b] = a;
          if(rank[a] == rank[b]) {
              rank[a]++;
          }
  
      }
  
      public static void makeSet(int[] parent, int[] rank, int v) {
          parent[v] = v;
          rank[v] = 0;
      }
  
      public static long modularDivision(long a, long b, int mod) {
          if(a==0) return 1;
          a %= mod;
          long res = 1L;
          while(b > 0) {
              if((b&1)==1) {
                  res = (res * a)%mod;
              }
              a = (a*a)%mod;
              b >>= 1;
          }
          return res;
      }
  
      public static void customSort(int[] arr) {
          int n = arr.length;
          Random rnd = new Random();
          for(int i=0; i<n; ++i){
              int tmp = arr[i];
              int randomPos = i + rnd.nextInt(n-i);
              arr[i] = arr[randomPos];
              arr[randomPos] = tmp;
          }
          Arrays.sort(arr);
          return;
      }
  
      public static void customSortLong(long[] arr) {
          int n = arr.length;
          Random rnd = new Random();
          for(int i=0; i<n; ++i){
              long tmp = arr[i];
              int randomPos = i + rnd.nextInt(n-i);
              arr[i] = arr[randomPos];
              arr[randomPos] = tmp;
          }
          Arrays.sort(arr);
          return;
      }
  
      public static long[] factorial(int n, int mod) {
          long[] fact = new long[n+1];
          fact[0] = 1;
          for(int i=1;i<fact.length;i++) {
              fact[i] = (i*fact[i-1] + mod)%mod;
          }
          return fact;
      }
  
      public static long[] invfactorial(int n, int mod, long[] fact) {
          long[] invfact = new long[n+1];
          invfact[0] = 1L;
          for(int i=1;i<=n;i++) {
              invfact[i] = modularDivision(fact[i], mod-2, mod);
          }
          return invfact;
      }
  
      public static List<Integer> primeNumbers(int num) {
          boolean[] arr = new boolean[num+1];
          List<Integer> primes = new ArrayList<>();
  
          for(int i=2;i*i<=num;i++) {
              if(!arr[i]) {
                  for(int j=i;j*i<=num;j++) {
                      arr[j*i] = true;
                  }
              }
          }
  
          for(int i=2;i<=num;i++) {
              if(!arr[i]) {
                  primes.add(i);
              }
          }
          return primes;
      }
  
      public static long ncr(int n, int r, long mod, long[] fact, long[] invfact) {
          if(n<0 || r<0 || n < r) {
              return 0;
          }
          long temp = (fact[n]*invfact[n-r])%mod;
          temp = (temp*invfact[r])%mod;
          return temp;
      }
  
  
  }