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.IOException;
  import java.io.InputStreamReader;
  import java.io.PrintWriter;
  import java.util.StringTokenizer;
  
  public class d {
  	public static void main(String[] args) {
  		FastScanner scan=new FastScanner();
  		PrintWriter out=new PrintWriter(System.out);
  
  		int n=scan.nextInt();
  		int k=scan.nextInt();
  		char[] aa=scan.next().toCharArray();
  		int[] a=new int[n];
  		int ones=0;
  		for(int i=0;i<n;i++) {
  			a[i]=(int)(aa[i]-'0');
  			if(a[i]==1) ones++;
  		}
  		
  		if(k==0||k>ones) {
  			out.println(1);
  		}
  		else {
  			fac=new long[n+1];
  			invfac=new long[n+1];
  			fac[0]=invfac[0]=1;
  			
  			for(int i=1;i<fac.length;i++) {
  				fac[i]=mult(fac[i-1],i);
  				invfac[i]=pow(fac[i],MOD-2);
  			}
  			long res=0L;
  			int l=0, r=0;
  			int f=0;
  			while(l<n) {
  				int end=-1;
  				while(r<n&&f<=k) {
  					if(f==k&&end==-1) end=r;
  					if(a[r]==1&&f+1>k) break;
  					else if(a[r]==1) f++;
  					r++;
  				}
  				if(k!=f) break;
  				if(end==-1) end=n;
  				int leftspace=end-l;
  				int rightspace=r-end;
  				if(l==0) {
  					res=add(res,choose(leftspace+rightspace,k));
  				}
  //				else if(r==n) {
  //					res=add(res,choose(leftspace+rightspace-1,k));
  //				}
  				else {
  					res=add(res,choose(leftspace+rightspace,k));
  					res=sub(res,choose(leftspace-1,k-1));
  //					if(k-1>0) res=add(res,choose(rightspace+1,k-1));
  				}
  				while(f==k) {
  					if(a[l++]==1) f--;
  				}
  			}
  			out.println(res);
  		}
  		out.close();
  	}
  	public static long pow(long b, long e) {
  		if(e==0L) return 1L;
  		if(e%2==0) {
  			long temp=pow(b,e/2);
  			return mult(temp,temp);
  		}
  		return mult(b,pow(b,e-1));
  	}
  	static long[] fac,invfac;
  	static long choose(int n, int k) {
  		if(n<k) return 0;
  		return mult(mult(fac[n],invfac[n-k]),invfac[k]);
  	}
  	public static long add(long a, long b) {
  		return (a%MOD+b%MOD)%MOD;
  	}
  	public static long sub(long a, long b) {
  		long x=a%MOD-b%MOD;
  		while(x<0) x+=MOD;
  		return x;
  	}
  	public static long mult(long a, long b) {
  		return ((a%MOD)*(b%MOD))%MOD;
  	}
  	static final int MOD=998244353;
  	static long[][][] dp;
  	static class FastScanner {
  		BufferedReader br;
  		StringTokenizer st;
  
  		public FastScanner() {
  			try	{
  				br = new BufferedReader(new InputStreamReader(System.in));
  				st = new StringTokenizer(br.readLine());
  			} catch (Exception e){e.printStackTrace();}
  		}
  
  		public String next() {
  			if (st.hasMoreTokens())	return st.nextToken();
  			try {st = new StringTokenizer(br.readLine());}
  			catch (Exception e) {e.printStackTrace();}
  			return st.nextToken();
  		}
  
  		public int nextInt() {return Integer.parseInt(next());}
  
  		public long nextLong() {return Long.parseLong(next());}
  
  		public double nextDouble() {return Double.parseDouble(next());}
  
  		public String nextLine() {
  			String line = "";
  			if(st.hasMoreTokens()) line = st.nextToken();
  			else try {return br.readLine();}catch(IOException e){e.printStackTrace();}
  			while(st.hasMoreTokens()) line += " "+st.nextToken();
  			return line;
  		}
  	}
  }
  