max_K = 10**6 MOD = 998244353 fact =[-1] * (max_K+1) #MOD下での階乗 inv =[-1] * (max_K+1) #MOD下での逆元 fact_inv=[-1] * (max_K+1) #MOD下での階乗の逆元 fact[0]=fact[1]=1 inv[1] = 1 fact_inv[0]=fact_inv[1] = 1 for i in range(2,max_K+1): fact[i] = (fact[i-1]*i)%MOD inv[i] = (-inv[MOD%i]*(MOD//i))%MOD fact_inv[i] = (fact_inv[i-1]*inv[i])%MOD def comb(n,r,MOD): if n < r: return 0 return fact[n]*fact_inv[n-r]%MOD*fact_inv[r]%MOD N,K = map(int,input().split()) S = input() tmp = 0 hima = 0 for i in range(N): if i != 0: if S[i] == "N" and S[i-1] != "C": tmp += 1 else: if S[i] == "N": tmp += 1 if S[i] == "N": hima += 1 ans = 0 for i in range(1,hima-K+1): ans += comb(tmp,i,MOD) ans %= MOD print(ans)