#include<iostream>
#include<string>
#include<algorithm>
using namespace std;

long long MM = 998244353, ans;
int SA[200010], invSA[200010];
long long N, K;
string S;

long long f()
{
	int i;
	long long c = 1;
	for (i = 0; i <= N; i++) invSA[SA[i]] = i;
	for (i = 2; i <= N; i++)
	{
		if (invSA[SA[i] + 1] < invSA[SA[i - 1] + 1]) c++;
	}
	return c;
}

long long powmm(long long a, long long b)
{
	if (b == 0) return 1;
	long long ans = powmm(a, b / 2);
	ans = (ans * ans) % MM;
	if (b % 2 == 1) ans = (ans * a) % MM;
	return ans;
}

int main()
{
	int i, c;
	cin >> N >> K;
	SA[0] = N;
	for (i = 1; i <= N; i++) { cin >> SA[i]; }
	c = f();
	if (c > K) { cout << 0 << endl; return 0; }
	ans = 1;
	for (i = 1; i <= K - c + N; i++) ans = (ans * i) % MM;
	for (i = 1; i <= K - c; i++) ans = (ans * powmm(i, MM - 2)) % MM;
	for (i = 1; i <= N; i++) ans = (ans * powmm(i, MM - 2)) % MM;
	
	cout << ans;

	return 0;
}