#include <bits/stdc++.h>
const int32_t MAX_N = 300010;
const int32_t mod = 998244353;
int32_t fact[MAX_N];
int32_t power(int32_t base, int32_t n) {
  int32_t res = 1;
  for (; n != 0; n /= 2) {
    if (n & 1) res = 1ll * res * base % mod;
    base = 1ll * base * base % mod;
  }
  return res;
}
inline int32_t c(int32_t n, int32_t m) {
  if (n < 0 || m < 0 || n - m < 0) return 0;
  return 1ll * fact[n] * power(fact[m], mod - 2) % mod *
         power(fact[n - m], mod - 2) % mod;
}
int32_t main() {
  fact[0] = 1;
  for (int32_t i = 1; i < MAX_N; i++) fact[i] = 1ll * i * fact[i - 1] % mod;
  int32_t n, k;
  scanf("%d%d", &n, &k);
  std::vector<int32_t> s;
  s.reserve(n + n);
  std::vector<std::pair<int32_t, int32_t>> a(n);
  for (int32_t i = 0; i < n; i++) {
    scanf("%d%d", &a[i].first, &a[i].second);
    s.push_back(a[i].first);
    s.push_back(a[i].second);
  }
  std::sort(s.begin(), s.end());
  s.erase(std::unique(s.begin(), s.end()), s.end());
  std::vector<int32_t> in(s.size()), out(s.size() + 1);
  for (int32_t i = 0; i < n; i++) {
    in[std::lower_bound(s.begin(), s.end(), a[i].first) - s.begin()]++;
    out[std::upper_bound(s.begin(), s.end(), a[i].second) - s.begin()]++;
  }
  int32_t ans = 0, sum = 0;
  for (int32_t i = 0; i < s.size(); i++) {
    sum -= out[i];
    ans += c(sum + in[i], k);
    if (mod <= ans) ans -= mod;
    ans -= c(sum, k);
    if (ans < 0) ans += mod;
    sum += in[i];
  }
  printf("%d\n", ans);
  return 0;
}
