#include #define rep(i,n) for(int i = 0; i < n; i++) //[0,n) #define srep(i,a,b) for(int i = a; i < b; i++) //[a,b) #define all(A) (A).begin(),(A).end() #define rall(A) (A).rbegin(),(A).rend() #define pmt(A) next_permutation(A) using namespace std; using ll = long long; using ull = unsigned long long; using P = pair; using pq = priority_queue>; const ll inf = 8e18; const int iinf = (int)1e9; const int mod9 = 998244353; const int mod1 = 1000000007; struct Edge { int to; ll cost; int from; }; bool compe(const Edge &e,const Edge &e2){ return e.cost < e2.cost; } using Graph = vector>; using EGraph = vector; using SGraph = vector>; template int siz(T& a){ return (int)a.size(); } double squa(double x){ return 1.0*x*x; } double pi = acos(-1); using namespace std; ll const MAX = 303030; ll const MOD = mod9; ll fac[MAX],finv[MAX],inv[MAX]; void Cinit(){ fac[0] = fac[1] = 1; finv[0] = finv[1] = 1; inv[1] = 1; srep(i,2,MAX){ fac[i] = fac[i-1]*i%MOD; inv[i] = MOD-inv[MOD%i]*(MOD/i)%MOD; finv[i] = finv[i-1]*inv[i]%MOD; } } ll nCr(int n,int k){ if(n < k || (n < 0 || k < 0)) return 0; return fac[n]*(finv[k]*finv[n-k]%MOD)%MOD; } int main(){ int n,k; cin >> n >> k; string s; cin >> s; int cnt = 0,ncnt = 0; rep(i,n){ if(i+1 < n && s[i] == 'C' && s[i+1] == 'N') cnt++; if(s[i] == 'N') ncnt++; } k -= cnt; ncnt -= cnt; Cinit(); ll ans = 0; srep(i,k,ncnt) (ans += nCr(ncnt,i)) %= mod9; cout << ans << endl; }