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: /*
   * akshaygupta26
   */
  import java.io.*;
  import java.util.*;
  public class B
  {
  	
  	static long mod =(long)(998244353);
  	static long fact[]=new long[5001];
      public static void main(String[] args) 
  	{ 
  		FastReader sc=new FastReader(); 
  		StringBuilder ans=new StringBuilder();
  		int test=1;
  		fact[0]=fact[1]=1l;
  		for(int i=2;i<=5000;i++) {
  			fact[i] = mult(i, fact[i-1]);
  		}
  		
  		while(test-->0)
  		{
  			int n =sc.nextInt();
  			int k =sc.nextInt();
  			char str[]=sc.next().toCharArray();
  			long comb=0;
  			if( k == 0) {
  				ans.append(1+"\n");
  			}
  			else if(k == 1) {
  				comb=1;
  				int zero_cnt[]=new int[n];
  				zero_cnt[0]=str[0] == '0'?1:0;
  				for(int i=1;i<n;i++) {
  					zero_cnt[i] = zero_cnt[i-1];
  					if(str[i] == '0') zero_cnt[i]++;
  				}
  				int lastone=-1;
  				for(int i=0;i<n;i++) {
  					if(str[i] == '1') {
  						long left = zero_cnt[i];
  						if(lastone != -1) left-=zero_cnt[lastone];
  						lastone=i;
  						long right = 0;
  						int r=i+1;
  						while(r<n && str[r] != '1') {
  							++right;
  							++r;
  						}
  						i=r-1;
  						comb=add(comb,add(left,right));
  					}
  				}
  				ans.append(comb+"\n");
  			}
  			else {
  				int l=0;
  				int r=0;
  				int ones=str[0] == '0'?0:1;
  				int zeros=ones^1;
  				
  				while(r+1<n && ones<k) {
  					r++;
  					if(str[r] == '1') ++ones;
  					else ++zeros;
  				}
  				if(ones<k) {
  					ans.append(1+"\n");
  					continue;
  				}
  				while(r+1<n && str[r+1] == '0') {
  					++zeros;
  					r++;
  				}
  								
  				
  				comb=add(comb, calculate(ones, zeros, r-l+1));
  				
  				if(str[0] == '0') zeros--;
  				else ones--;
  				
  				for(l=1;l<n;l++) {
  					if(l>r) {
  						if(str[l] == '0') zeros++;
  						else ones++;
  					}
  					if(ones >= k) {
  						if(str[l] == '0') zeros--;
  						else ones--;
  						continue;
  					}
  					
  					
  					int r_prv=r;
  					int zeros_prv=zeros;
  					int ones_prv=ones;
  					
  					r=Math.max(r, l);
  					
  					while(ones<k && r+1<n) {
  						r++;
  						if(str[r] == '1') ++ones;
  						else ++zeros;
  					}
  					while(r+1<n && str[r+1] == '0') {
  						++zeros;
  						r++;
  					}
  					if(ones < k) break;
  					
  //					System.out.println(l+" "+r);
  					
  					if(l>r_prv) {
  						comb=add(comb, calculate(ones, zeros, r-l+1));
  						continue;
  					}
  					
  					
  					
  									
  					long totalComb = calculate(ones, zeros, r-l+1);
  					long unlikedComb = calculate(ones_prv, zeros_prv, r_prv-l+1);
  					
  					long diff = totalComb - unlikedComb;
  					
  					if(diff<0) diff+=mod;
  					
  					comb = add(comb, diff);
  					
  					//TODO: REDUCE ZEROS/ ONES
  					if(str[l] == '0') zeros--;
  					else ones--;
  				}
  				
  				ans.append(comb+"\n");
  			}
  		}
  		
  	    System.out.print(ans);
  	} 
      
      static long calculate(int a,int b,int n) {
      	long ans=0;
      	ans = fact[n];
  
      	ans = mult(fact[n], binexp(mult(fact[a],fact[b]),mod-2));
      	return ans;
      }
      
      static long binexp(long a,long b) {
      	if(b == 0) return 1;
      	long temp = binexp(a, b/2);
      	temp=mult(temp,temp);
      	if(b%2 == 1) temp=mult(temp,a);
      	return temp;
      }
      
      static long ceil(double a,double b) {
      	return (long)Math.ceil(a/b);
      }
      static long add(long a,long b) {
      	return (a+b)%mod;
      }
      static long mult(long a,long b) {
      	return (a*b)%mod;
      }
   
      static long _gcd(long a,long b) {
      	if(b == 0) return a;
      	return _gcd(b,a%b);
      }
      
      static final Random random=new Random();
      
  	static void ruffleSort(int[] a) {
  		int n=a.length;//shuffle, then sort 
  		for (int i=0; i<n; i++) {
  			int oi=random.nextInt(n), temp=a[oi];
  			a[oi]=a[i]; a[i]=temp;
  		}
  		Arrays.sort(a);
  	}
  	
  	static void ruffleSort(long[] a) {
  		int n=a.length;//shuffle, then sort 
  		for (int i=0; i<n; i++) {
  			int oi=random.nextInt(n);
  			long temp=a[oi];
  			a[oi]=a[i]; a[i]=temp;
  		}
  		Arrays.sort(a);
  	}
  	
  	static class FastReader 
  	{ 
  		BufferedReader br; 
  		StringTokenizer st; 
  
  		public FastReader() 
  		{ 
  			br = new BufferedReader(new
  					InputStreamReader(System.in)); 
  		} 
  
  		String next() 
  		{ 
  			while (st == null || !st.hasMoreElements()) 
  			{ 
  				try
  				{ 
  					st = new StringTokenizer(br.readLine()); 
  				} 
  				catch (IOException e) 
  				{ 
  					e.printStackTrace(); 
  				} 
  			} 
  			return st.nextToken(); 
  		} 
  
  		int nextInt() 
  		{ 
  			return Integer.parseInt(next()); 
  		} 
  
  		long nextLong() 
  		{ 
  			return Long.parseLong(next()); 
  		} 
  
  		double nextDouble() 
  		{ 
  			return Double.parseDouble(next()); 
  		} 
  
  		String nextLine() 
  		{ 
  			String str = ""; 
  			try
  			{ 
  				str = br.readLine(); 
  			} 
  			catch (IOException e) 
  			{ 
  				e.printStackTrace(); 
  			} 
  			return str; 
  		} 
  	} 
  
  
  } 
  