#include <bits/stdc++.h>   #define task  suffixarray    #define ll long long   #define FOR( i, l, r) for(int i = (l), _r = (r); i <= _r; ++i)   #define FOD( i, l, r) for(int i = (l), _r = (r); i >= _r; --i)   #define REP( i, n)    for(int i = 0, _n = (n); i < _n; ++i)   #define pii pair<int,int>   #define fi  first   #define se  second   #define MASK(x)  (1ll << (x))   #define BIT(x,k) (((x) >> (k)) & 1ll)   #define OFF(x,k) ((x) & ~(1ll << (k)))   #define ON(x,k)  ((1ll << (k)) | (x))   #define endl   n    #define __builtin_popcount __builtin_popcountll   /*    Author: Diem Quynh :>> //d_quynh_2811   */   using namespace std;   int const N = 4e5 + 5;   int const mod = 998244353;   int n, k, a[N], idx[N], fact[N], ifact[N];   int num = 1, ans;   void inp()   {       cin >> n >> k;       FOR( i, 1, n)       {           cin >> a[i];           ++a[i];           idx[a[i]] = i;       }   }   int Pow(int a, int b)   {       if(b == 0)           return 1;       int tmp = Pow(a, b / 2);       if(b & 2)           return (1ll * tmp * tmp) % mod * a % mod;       return 1ll * tmp * tmp % mod;   }   int nCk(int n, int k)   {       return 1ll * fact[n] * ifact[k] % mod * ifact[n - k] % mod;   }   void solve()   {       FOR( i, 1, n - 1) k += idx[a[i] + 1] < idx[a[i + 1] + 1];       if(n > k)       {           cout << 0;           return;       }       fact[0] = 1;       FOR( i, 1, k) fact[i] = (1ll * fact[i - 1] * i) % mod;       ifact[k] = Pow(fact[k], mod - 2);       FOD( i, k - 1, 0) ifact[i] = 1ll * (i + 1) * ifact[i + 1] % mod;       cout << nCk(k, n);   }   int main()   {       ios_base::sync_with_stdio(0);       cin.tie(0);       cout.tie(0);   //    freopen(task .inp , r ,stdin);   //    freopen(task .out , w ,stdout);       inp();       solve();       return 0;   }   