#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <cmath>
#include <random>
#include <chrono>
#include <set>
#include <queue>
#include <stack>
#include <deque>
#include <cstring>
const long long big = 998244353;
using namespace std;
long long power(long long a, long long n) {
  if (n == 0)
    return 1;
  if (n % 2 == 1)
    return (power(a, n - 1) * a) % big;
  else {
    long long b = power(a, n / 2);
    return (b * b) % big;
  }
}
int gcd(int a, int b) {
  if (b == 0)
    return a;
  else
    return gcd(b, a % b);
}
int t2[1000000];
void build_min(int a[], int v, int tl, int tr) {
  if (tl >= tr)
    t2[v] = a[tl];
  else {
    int tm = (tl + tr) / 2;
    build_min(a, v * 2, tl, tm);
    build_min(a, v * 2 + 1, tm + 1, tr);
    t2[v] = min(t2[v * 2], t2[v * 2 + 1]);
  }
}

int sum_min (int v, int tl, int tr, int l, int r) {
  if (l > r)
    return 1000000;
  if (l == tl && r == tr)
    return t2[v];
  int tm = (tl + tr) / 2;
  return min(sum_min (v*2, tl, tm, l, min(r,tm))
      , sum_min (v*2+1, tm+1, tr, max(l,tm+1), r));
}


int t[1000000];
void build_max(int a[], int v, int tl, int tr) {
  if (tl >= tr)
    t[v] = a[tl];
  else {
    int tm = (tl + tr) / 2;
    build_max(a, v * 2, tl, tm);
    build_max(a, v * 2 + 1, tm + 1, tr);
    t[v] = max(t[v * 2], t[v * 2 + 1]);
  }
}

void update(int v, int tl, int tr, int l, int r, int add) {
  if (l > r)
    return;
  if (l == tl && tr == r)
    t[v] += add;
  else {
    int tm = (tl + tr) / 2;
    update(v * 2, tl, tm, l, min(r, tm), add);
    update(v * 2 + 1, tm + 1, tr, max(l, tm + 1), r, add);
  }
}

int get(int v, int tl, int tr, int pos) {
  if (tl == tr)
    return t[v];
  int tm = (tl + tr) / 2;
  if (pos <= tm)
    return t[v] + get(v * 2, tl, tm, pos);
  else
    return t[v] + get(v * 2 + 1, tm + 1, tr, pos);
}

int sum_max (int v, int tl, int tr, int l, int r) {
  if (l > r)
    return -1000000;
  if (l == tl && r == tr)
    return t[v];
  int tm = (tl + tr) / 2;
  return max(sum_max (v*2, tl, tm, l, min(r,tm))
      , sum_max (v*2+1, tm+1, tr, max(l,tm+1), r));
}

class Cmp {
 public:
  bool operator()(vector<long long>& a, vector<long long>& b) {
    return a.size() > b.size();
  }
};




void solve() {
  long long n, k;
  cin >> n >> k;
  vector<long long> sa(n);
  for (int i = 0; i < n; ++i) {
    cin >> sa[i];
  }
  vector<long long> tmp(n);
  for (int i = 0; i < n; ++i) {
    tmp[sa[i]] = i;
  }
  long long cur = 0;
  vector<long long> s(n);
  s[sa[0]] = 0;
  for (int i = 1; i < n; ++i) {
    long long j = sa[i - 1];
    long long l = sa[i];
    if (l == n - 1 || (j < n - 1 && tmp[j + 1] > tmp[l + 1]))
      cur++;
    s[sa[i]] = cur;
  }
  long long dif = k;
  for (long long i: s) {
//    cout << i << ' ';
    if (k - i - 1 < dif) {
      dif = k - i - 1;
    }
  }
  if (dif < 0) {
    cout << 0;
    return;
  } else if (dif == 0) {
    cout << 1;
    return;
  } else {
    long long ans = 1;
    for (int i = 1; i <= dif; ++i) {
      ans *= (n + i);
      ans %= big;
      ans *= power(i, big - 2);
      ans %= big;
    }
    cout << ans;
  }

}

int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long t = 1;
//  cin >> t;
  //cout.precision(20);
  while (t--) {
    solve();
  }
}