#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N=2e5+5,mod=998244353;
int n,k,rk[N],a[N],ct;
ll jc[N],jv[N],ans;
ll ksm(ll di,ll mi) {ll res=1; for(;mi;mi>>=1,di=di*di%mod) if(mi&1) res=res*di%mod; return res;}
ll c(ll a,ll b) {return a>=b? jc[a]*jv[a-b]%mod*jv[b]%mod:0;}
signed main()
{
	int i,j;
	scanf("%d%d",&n,&k);
	for(i=jc[0]=1;i<N;i++) jc[i]=jc[i-1]*i%mod;
	for(jv[N-1]=ksm(jc[N-1],mod-2),i=N-2;~i;i--) jv[i]=jv[i+1]*(i+1)%mod;
	for(i=1;i<=n;i++) scanf("%d",&a[i]),rk[a[i]]=i;
	for(i=1;i<n;i++) if(rk[a[i]+1]>rk[a[i+1]+1]) ct++;
	for(i=ct+1;i<=k;i++) ans=(ans+c(n-1-ct,i-ct-1)*c(k,i))%mod;
	cout<<ans;
	return 0;
}