/** try <3 **/
#include<bits/stdc++.h>

using namespace std;

#define task "sol"
#define lb lower_bound
#define ub upper_bound
#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define zs(v) ((int)(v).size())
#define BIT(x, i) (((x) >> (i)) & 1)
#define CNTBIT __builtin_popcountll
#define ALL(v) (v).begin(),(v).end()
#define endl '\n'

typedef long double ld;
typedef long long ll;
typedef pair<int, int> pii;

const int dx[4]={-1, 0, 1, 0}, dy[4]={0, 1, 0, -1};
const int dxx[8]={-1, -1, 0, 1, 1, 1, 0, -1}, dyy[8]={0, 1, 1, 1, 0, -1, -1, -1};

const ll mod=998244353 ; /// 998244353
const int base=311;
const int N=2e5+5;

int n,k;
int a[N],pos[N];
ll gt[N];

ll binpow(ll n, ll k)
{
    if(k==0) return 1;
    ll t=binpow(n,k/2);
    t=t*t%mod;
    if(k&1) t=t*n%mod;
    return t;
}
int C(int k, int n)
{
    if(k>n) return 0;
    return gt[n]*binpow(gt[k]*gt[n-k]%mod,mod-2)%mod;
}
void add(int &a, int b)
{
    a+=b;
    if(a>=mod) a-=mod;
}
void gogo()
{
    cin>>n>>k;
    for(int i=1;i<=n;++i)
    {
        cin>>a[i];
        a[i]++;
        pos[a[i]]=i;
    }
    gt[0]=1;
    for(int i=1;i<=N-5;++i) gt[i]=gt[i-1]*i%mod;
    int cnt=1;
    for(int i=1;i<n;++i)
    {
//        cout<<a[i]<<' '<<a[i+1]<<' '<<pos[a[i]+1]<<' '<<pos[a[i+1]+1]<<'\n';
        if(pos[a[i]+1]>pos[a[i+1]+1])
        {
            cnt++;
        }
    }
//    cout<<cnt<<endl;
    int ans=0;
    for(int i=cnt;i<=min(n,k);++i)
    {
        /// choose i-cnt such that it will not be equal
        add(ans,(ll)C(i,k)*C(i-cnt,n-cnt)%mod);
    }
    cout<<ans;
}
int main()
{
    ios_base::sync_with_stdio(0); cin.tie(0);
    if(fopen(task".inp", "r"))
    {
        freopen(task".inp", "r", stdin);
        freopen(task".out", "w", stdout);
    }
    gogo();
}






