from functools import cache import sys sys.setrecursionlimit(10**6) MOD = 998244353 N, K = map(int, input().split()) S = ['P'] + list(input()) @cache def fact(n): if n == 0: return 1 return fact(n-1) * n % MOD @cache def inv_fact(n): return pow(fact(n), -1, MOD) def comb(n, r): return fact(n) * inv_fact(n-r) * inv_fact(r) % MOD max_plan = S.count('N') - K cnt = sum(1 for i in range(1, N+1) if S[i] == 'N' and S[i-1] != 'C') print(sum(comb(cnt, i) for i in range(1, min(max_plan, cnt) + 1)) % MOD)