#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
#pragma GCC target("avx,avx2,fma")
#pragma GCC optimization("unroll-loops")
using namespace std;
const int maxn = 3e5 + 5;
const long long mod = 998244353;
const double eps = 1e-6L;
struct node {
  int l, r;
  bool operator<(const node& k) const {
    if (l == k.l) return r > k.r;
    return l < k.l;
  }
} a[maxn];
long long fac[maxn], f[maxn], inv[maxn];
void init() {
  fac[1] = 1;
  f[1] = 1;
  inv[1] = 1;
  for (long long i = 2; i <= maxn; i++) {
    fac[i] = fac[i - 1] * i % mod;
    f[i] = (mod - mod / i) * f[mod % i] % mod;
    inv[i] = inv[i - 1] * f[i] % mod;
  }
}
long long C(long long m, long long n) {
  if (m < n) return 0;
  if (n == 0 || m == n) return 1;
  return fac[m] * inv[n] % mod * inv[m - n] % mod;
}
int b[maxn];
int main() {
  int T = 1;
  init();
  while (T--) {
    int n, k, m = 1;
    scanf("%d %d", &n, &k);
    for (int i = 0; i < n; i++) {
      scanf("%d %d", &a[i].l, &a[i].r);
      b[i] = a[i].r;
    }
    sort(a, a + n);
    sort(b, b + n);
    int left = a[0].l, right = a[0].r;
    long long ans = 0;
    bool flag = true;
    for (int i = n - 1; i >= 0; i--) {
      int num = i + 1 - (lower_bound(b, b + n, a[i].l) - b);
      ans = (ans + C(num - 1, k - 1)) % mod;
    }
    printf("%lld\n", ans);
  }
  return 0;
}
