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

#define   fi(a,b) for(int i=a;i<b;i++)
#define   fj(a,b) for(int j=a;j<b;j++)
#define   ff first
#define   ss second
#define   ll long long
#define   ld long double
#define   ull unsigned long long
#define   bp(x) __builtin_popcount(x)
#define   pr(x) for(auto it: x) cout<<it<<" "; cout<<endl;
#define   getMax(x) max_element(x.begin(),x.end())
#define   getMin(x) min_element(x.begin(),x.end())
#define   endl "\n"
typedef   vector<int> vi;
typedef   vector< pair<int, int> > vii;
typedef   vector<long long> vl;
typedef   pair<int, int> pii;
typedef   pair<ll, ll> pll;
typedef   vector< pair<ll, ll> > vll;

mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
// auto dist = uniform_int_distribution<int>(l, r);
// int dx[] = {1, 0, -1, 0};
// int dy[] = {0, 1, 0, -1};
// int dx[] = { -1, 0, 1, 1, 1, 0, -1, -1};
// int dy[] = { -1, -1, -1, 0, 1, 1, 1, 0};

const int MOD = 998244353;

const int N = 1e6 + 10;

ll fac[N], modInv[N];

long long power(long long x, long long y) {
	long long res = 1;
	x = x % MOD;
	while (y > 0) {
		if (y & 1)
			res = (res * x) % MOD;
		y = y >> 1;
		x = (x * x) % MOD;
	}
	return res;
}

long long modInverse(ll x) {
	return power(x, MOD - 2);
}

long long modAdd(long long a, long long b) {
	return (a % MOD + b % MOD + 2 * MOD) % MOD;
}

long long modMult(long long a, long long b) {
	return (a % MOD * b % MOD) % MOD;
}

long long modDiv(long long a, long long b) {
	return (a % MOD * modInverse(b)) % MOD;
}

ll nCrModP(ll n, ll r) {
	if (r == 0) return 1;
	return ((fac[n] * modInv[r]) % MOD * modInv[n - r]) % MOD;
}

void compute() {
	fac[0] = 1;
	modInv[0] = 1;
	for (ll i = 1; i < N; i++) {
		fac[i] = (fac[i - 1] * i) % MOD ;
		modInv[i] = modInverse(fac[i]);
	}
}


void omae_wa_mou_shindeiru(int tc) {
	ll n, k;
	cin >> n >> k;
	vl v(n + 1), pos(n + 1);
	--k;
	fi(0, n) {
		cin >> v[i];
		pos[v[i]] = i;
	}
	pos[n] = -1;
	int cnt = 0;
	fi(0, n - 1) {
		if (pos[v[i] + 1] > pos[v[i + 1] + 1]) {
			++cnt;
		}
	}
	if (cnt > k) {
		cout << 0 << endl;
		return;
	}
	cout << nCrModP(n + k - cnt, n) << endl;

}

int main() {
	ios::sync_with_stdio(0);
	cin.tie(0);
	int tc = 1;
	// cin >> tc;
	compute();
	fi(1, tc + 1) {
		omae_wa_mou_shindeiru(i);
	}
}
