#include<bits/stdc++.h>
using namespace std;
int read(){
	int x=0,pos=1;char ch=getchar();
	for(;!isdigit(ch);ch=getchar()) if(ch=='-') pos=0;
	for(;isdigit(ch);ch=getchar()) x=(x<<1)+(x<<3)+ch-'0';
	return pos?x:-x;
}
#define FOR(i,a,b) for(int i=a;i<=b;++i)
#define ROF(i,a,b) for(int i=a;i>=b;--i)
const int N = 5e5+200;
int a[N],pos[N];
const int mod = 998244353;
int F[N],G[N];
int C(int a,int b){
	if(a<b||a<0||b<0) return 0;
	return 1ll*F[a]*G[b]%mod*G[a-b]%mod;
}
int ksm(int a,int b){
	int res=1;while(b){
		if(b&1) res=1ll*res*a%mod;
		a=1ll*a*a%mod;b>>=1;
	}return res;
}
int main(){
	int n=read(),k=read();
	F[0]=1;FOR(i,1,N-1) F[i]=1ll*F[i-1]*i%mod;
	G[N-1]=ksm(F[N-1],mod-2);ROF(i,N-2,0) G[i]=1ll*G[i+1]*(i+1)%mod;
	FOR(i,1,n){
		a[i]=read()+1;
		pos[a[i]]=i;
	}
	pos[n+1]=-1;int cnt=0;
	FOR(i,1,n-1){
		if(pos[a[i]+1]>pos[a[i+1]+1]) cnt++;
	}//k--;
	printf("%d\n",C(n-1+k-cnt,n));
	return 0;
}