//by szh
#include<bits/stdc++.h>
using namespace std;

#define fi first
#define se second
#define pii pair<int,int>
#define pll pair<long long,long long>
#define pb push_back
#define debug(x) cerr<<#x<<"="<<x<<endl
#define pq priority_queue
#define inf 0x3f
#define rep(i,a,b) for (int i=a;i<(b);i++)
#define MP make_pair
#define SZ(x) (int(x.size()))
#define ll long long
#define mod 998244353
#define ALL(x) x.begin(),x.end()
void inc(int &a,int b) {a=(a+b)%mod;}
void dec(int &a,int b) {a=(a-b+mod)%mod;}
int lowbit(int x) {return x&(-x);}
ll p0w(ll base,ll p) {ll ret=1;while(p>0){if (p%2ll==1ll) ret=ret*base%mod;base=base*base%mod;p/=2ll;}return ret;}

const int maxn=4e5+10;

int n,m;
int a[maxn];
int pos[maxn];
ll fact[maxn];

int C(int x,int y) {
	if (y==0||x==y) return 1;
	if (y>x) return 0;
	return fact[x]*p0w(fact[y],mod-2)%mod*p0w(fact[x-y],mod-2)%mod;
}

int main() {
//	freopen("input.txt","r",stdin);	
	std::ios::sync_with_stdio(false);cin.tie();
	fact[0]=1;
	rep(i,1,maxn) fact[i]=fact[i-1]*(ll)i%mod;
	cin>>n>>m;
	rep(i,0,n) cin>>a[i],pos[a[i]]=i;
	int tmp=0;
	pos[n]=-1;
	rep(i,1,n) if (pos[a[i-1]+1]<=pos[a[i]+1]) tmp++;
	cout<<C(m+tmp,n);
	return 0;
}
