#include #include using mint = atcoder::modint998244353; using ll = long long; using namespace std; vector f0, f1; void init(int n) { f0.resize(n + 1); f0[0] = 1; for (int i = 1; i <= n; i++) { f0[i] = f0[i - 1] * i; } f1.resize(n + 1); f1[n] = f0[n].inv(); for (int i = n; i > 0; i--) { f1[i - 1] = f1[i] * i; } } mint comb(int n, int k) { if (n < k || k < 0) return 0; return f0[n] * f1[k] * f1[n - k]; } int main() { ios::sync_with_stdio(false); cin.tie(0); int n, k; cin >> n >> k; string s; cin >> s; init(n); int c = 0, d = 0; for (int i = 0; i < n; i++) { c += (i == 0 || s[i - 1] != 'C') && s[i] == 'N'; d += s[i] == 'N'; } mint x = 0; for (int i = 1; i <= d - k; i++) { x += comb(c, i); } cout << x.val() << endl; return 0; }