MOD = 998244353 N, K = map(int, input().split()) S = ['P'] + list(input()) if K > S.count('N'): print(0) exit() facts = [1] inv_facts = [1] for i in range(1, N): facts.append(facts[i-1] * i % MOD) inv_facts.append(inv_facts[i-1] * pow(i, MOD-2, MOD) % MOD) def comb(n, r): return facts[n] * inv_facts[n-r] * inv_facts[r] % MOD max_plan = S.count('N') - K cnt = 0 for i in range(1, N+1): if S[i] == 'N' and S[i-1] != 'C': cnt += 1 print(sum(comb(cnt, i) for i in range(1, min(max_plan, cnt) + 1)) % MOD)