#include <bits/stdc++.h>
#define BPhuong "main"
#define maxn 200009
#define fi(i, a, b) for(int i = a; i <= b; i++)
#define fid(i, a, b) for(int i = a; i >= b; i--)
#define ll long long

using namespace std;

int n, k, a[maxn], pos[maxn];
const ll mod = 998244353;
ll gt[maxn], cnt[maxn];
ll  mu(ll a, int p){
    if(p == 1) return a;
    if(p == 0) return 1;
    ll c = mu(a, p/2) % mod;
    c = c * c % mod;
    if(p % 2) return c * a % mod;
    else return c;
}
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr); cout.tie(nullptr);
    #ifndef ONLINE_JUDGE
    freopen(BPhuong ".inp", "r", stdin);
    freopen(BPhuong ".out", "w", stdout);
    #endif // ONLINE_JUDGE
    cin >> n >> k;
    //to hop
        gt[0] = 1;
        fi(i, 1, maxn - 4) gt[i] = gt[i - 1] * i % mod;
        cnt[maxn - 4] = mu(gt[maxn - 4], mod - 2);
        fid(i, maxn - 5, 0) cnt[i] = cnt[i + 1] * (i + 1) % mod;
    //_______________

    fi(i, 1, n) {cin >> a[i]; pos[a[i]] = i;}
    pos[n] = -1;
    int dem = 0, dem2 = 0;
    fi(i, 1, n - 1){
        int ok;
        if(pos[a[i] + 1] < pos[a[i + 1] + 1]) dem++;
        else dem2++;
    }
    ll res = 0; dem2++;
    if(dem2 <= k)
        fi(i, dem2, min(n, k)){
            int val = i - dem2;
            ll val0 = gt[k] % mod * cnt[i] % mod * cnt[k - i] % mod;
            ll val2 = gt[dem] % mod * cnt[val] % mod * cnt[dem - val] % mod;
            res  =( res + val2 * val0 % mod) % mod;
        }
    cout << res;
}
