/*
 * author: lcwyyds
 * time: 2021-05-28 22:05:58
 */
#include <bits/stdc++.h>
using namespace std;
template <typename A, typename B>
ostream &operator<<(ostream &os, const pair<A, B> &p) {
  return os << '(' << p.first << ", " << p.second << ')';
}
template <typename T_container, typename T = typename enable_if<
                                    !is_same<T_container, string>::value,
                                    typename T_container::value_type>::type>
ostream &operator<<(ostream &os, const T_container &v) {
  os << '{';
  string sep;
  for (const T &x : v)
    os << sep << x, sep = ", ";
  return os << '}';
}
void dbg_out() { cerr << endl; }
template <typename Head, typename... Tail> void dbg_out(Head H, Tail... T) {
  cerr << ' ' << H;
  dbg_out(T...);
}
#ifdef WA_DEBUG
#define dbg(...) cerr << "(" << #__VA_ARGS__ << "):", dbg_out(__VA_ARGS__)
#else
#define dbg(...)
#endif

using ll = long long;
using ull = unsigned long long;
#define pb push_back
#define fi first
#define se second
#define rep(i, a, b) for (int i = int(a); i <= (int)(b); i++)
#define per(i, a, b) for (int i = int(a); i >= (int)(b); i--)
const int mod = 998244353;
const int inf = 0x3f3f3f3f;
const int maxn = 2e5 + 10;
ll qpow(ll a, int b) {
  ll ans = 1;
  while (b) {
    if (b & 1)
      ans = ans * a % mod;
    a = a * a % mod;
    b >>= 1;
  }
  return ans;
}
ll jc[maxn], inv[maxn];
void cinit(int n) {
  jc[0] = inv[0] = 1;
  rep(i, 1, n) jc[i] = jc[i - 1] * i % mod;
  inv[n] = qpow(jc[n], mod - 2);
  per(i, n - 1, 1) inv[i] = inv[i + 1] * (i + 1) % mod;
}
ll C(int n, int m, int p = mod) {
  return m > n ? 0 : jc[n] * inv[m] % p * inv[n - m] % p;
}
int main() {
#ifndef WA_DEBUG
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
#endif
  cinit(maxn - 5);
  int n, k;
  cin >> n >> k;
  vector<int> a(n + 1), pos(n + 1);
  rep(i, 1, n) {
    cin >> a[i];
    pos[a[i]] = i;
  }
  pos[n] = 0;
  int num = 1, p = a[1];
  rep(i, 2, n) {
    int now = a[i];
    if (pos[p + 1] < pos[now + 1])
      p = now;
    else {
      p = now;
      num++;
    }
  }
  ll ans = 0;
  rep(i, num, n) {
    ans = ans + C(k, i) * C(n - num, i - num) % mod;
    ans %= mod;
  }
  cout << ans << '\n';
  return 0;
}
