import sys from functools import cache sys.setrecursionlimit(10**6) MOD = 998244353 @cache def fact(n): return 1 if n == 0 else 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 N, K = map(int, input().split()) S = ['P'] + list(input()) max_plan = S.count('N') - K cnt = len(list(filter(lambda i: S[i] == 'N' and S[i-1] != 'C', range(1, N+1)))) ans = sum(comb(cnt, i) for i in range(1, min(max_plan, cnt) + 1)) % MOD print(ans)