#include <bits/stdc++.h>
using namespace std;
const int INF = 0x3f3f3f3f;
const int N = 3e5 + 10;
const int mod = 998244353;
int bit[N * 2];
int lowbit(int x) { return x & -x; }
void add(int i, int up) {
  while (i <= up) {
    bit[i]++;
    i += lowbit(i);
  }
}
int query(int i) {
  int res = 0;
  while (i) {
    res += bit[i];
    i -= lowbit(i);
  }
  return res;
}
long long fac[N], ifac[N];
long long qpow(long long a, long long b) {
  long long res = 1;
  while (b) {
    if (b & 1) res = res * a % mod;
    a = a * a % mod;
    b >>= 1;
  }
  return res;
}
long long comb(long long n, long long m) {
  if (m < 0 || n < m) return 0;
  return fac[n] * ifac[m] % mod * ifac[n - m] % mod;
}
void init(int n) {
  fac[0] = 1;
  for (int i = 1; i <= n; i++) fac[i] = fac[i - 1] * i % mod;
  ifac[n] = qpow(fac[n], mod - 2);
  for (int i = n - 1; i >= 0; i--) ifac[i] = 1LL * (i + 1) * ifac[i + 1] % mod;
}
int main() {
  int n, k;
  scanf("%d%d", &n, &k);
  init(n);
  vector<pair<int, int>> a(n + 1);
  vector<int> xs;
  for (int i = 1; i <= n; i++) {
    scanf("%d%d", &a[i].first, &a[i].second);
    xs.push_back(a[i].first);
    xs.push_back(a[i].second);
  }
  sort(xs.begin(), xs.end());
  int cnt = unique(xs.begin(), xs.end()) - xs.begin();
  vector<pair<int, int>> b(n + 1);
  for (int i = 1; i <= n; i++) {
    b[i].first =
        lower_bound(xs.begin(), xs.begin() + cnt, a[i].first) - xs.begin() + 1;
    b[i].second =
        lower_bound(xs.begin(), xs.begin() + cnt, a[i].second) - xs.begin() + 1;
  }
  sort(b.begin(), b.end());
  long long ans = 0;
  for (int i = 1; i <= n; i++) {
    int x = query(b[i].first - 1);
    x = i - 1 - x;
    if (x >= k - 1) {
      long long add = comb(x, k - 1);
      ans += add;
      ans %= mod;
    }
    add(b[i].second, cnt);
  }
  printf("%lld\n", ans);
  return 0;
}
