#include<iostream>
#include<cstring>
#include<cstdio>
#include<climits>
#include<algorithm>
#include<queue>
#include<vector>
#define int long long
#define mod 998244353
#define pii pair<int,int>
#define mp make_pair
#define pb push_back
#define fi first
#define se second
using namespace std;
inline int read(){
	int f=1,ans=0; char c=getchar();
	while(c<'0'||c>'9'){if(c=='-')f=-1;c=getchar();}
	while(c>='0'&&c<='9'){ans=ans*10+c-'0';c=getchar();}
	return f*ans;
}
const int MAXN=2e5+11;
int N,sa[MAXN],rnk[MAXN],cnt,M;
int ksm(int a,int b){int ans=1;while(b){if(b&1) ans*=a,ans%=mod;a*=a,a%=mod;b>>=1;}return ans;}
int binom(int a,int b){
	if(a<b) return 0;
	int ans1=1,ans2=1;
	for(int i=a;i>=a-b+1;i--) ans1*=i,ans1%=mod;
	for(int i=2;i<=b;i++) ans2*=i,ans2%=mod;
	return ans1*ksm(ans2,mod-2)%mod;
}
signed main(){
	//freopen("2.in","r",stdin);
	N=read(),M=read(); for(int i=1;i<=N;i++) sa[i]=read(),rnk[sa[i]]=i;
	for(int i=1;i<N;i++){
		if(rnk[sa[i]+1]<rnk[sa[i+1]+1]) cnt++;
	}
	printf("%lld\n",binom(M+cnt,N)); return 0;
}/*
3 2
0 2 1
*/