#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef pair<int, int> ii;
typedef vector<ii> vii;
typedef long double ld;
#define FOR(i, a, b) for(int i = a; i < b; i++)
#define ROF(i, a, b) for(int i = a; i >= b; i--)
#define ms memset
#define pb push_back
#define F first
#define S second
ll MOD = 998244353;
 
ll power(ll base, ll n){
	if (n == 0) return 1;
	if (n == 1) return base;
	ll halfn = power(base, n/2);
	if (n % 2 == 0) return (halfn * halfn) % MOD;
	return (((halfn * halfn) % MOD) * base) % MOD;
}
 
ll inverse(ll n){
	return power(n, MOD-2);
}
 
ll add(ll a, ll b){
	return (a+b) % MOD;
}

ll mul(ll a, ll b){
	return (a*b) % MOD;
}

ll gcd(ll a, ll b){
	if (a == 0) return b;
	if (a == 1) return 1;
	return gcd(b % a, a);
}

int main(){
    ios::sync_with_stdio(false);
    int n, k; cin >> n >> k;
    vi a(n), pos(n+1); pos[n] = -1;
    FOR(i, 0, n){
    	cin >> a[i];
    	pos[a[i]] = i;
	}
	int cnt = 0;
	FOR(i, 1, n){
		if (pos[a[i]+1] < pos[a[i-1]+1]){
			cnt++;
		}
	}
	if (k < cnt+1){
		cout << 0 << '\n';
		return 0;
	}
	cnt = k - cnt;
	ll cur = 1;
	FOR(i, 1, n){
		cur = mul(cur, i);
	}
	ll perm = cur;
	ll ans = cur;
	FOR(i, 1, cnt){
		ll val = mul(inverse(i), n+i-1);
		cur = mul(cur, val);
		ans = add(ans, cur);
	}
	ans = mul(ans, inverse(perm));
	cout << ans << '\n';
	return 0;
}












