#include<iostream>
#include<algorithm>
using namespace std;
typedef long long ll;
const ll mod = 998244353;
const int max_n = 2e5+100;
ll J[max_n];
int suffix[max_n],rak[max_n],n,k;
inline ll POW(ll base,ll p){ll ans=1;while (p){if (p&1)ans=ans*base%mod;base=base*base%mod;p>>=1;}return ans;}
inline ll inv(ll num){return POW(num,mod-2);}
inline ll C(int n,int m){if (n<0||m<0||m>n)return 0;return J[n]*inv(J[m]*J[n-m]%mod)%mod;}
int main()
{
	ios::sync_with_stdio(0);
	J[0]=1;
	for (int i=1;i<max_n;++i)J[i]=J[i-1]*i%mod;
	cin>>n>>k;
	for (int i=1;i<=n;++i)
	{
		cin>>suffix[i];
		++suffix[i];
		rak[suffix[i]]=i;
	}
	int cnt=0;
	for (int i=1;i<n;++i)cnt+=(rak[suffix[i]+1]<rak[suffix[i+1]+1]);
	ll ans = 0;
	for (int i=n;i>=1;--i)ans = (ans+C(k,i)*C(cnt,n-i)%mod)%mod;
	cout<<ans<<endl;
}