#include <bits/stdc++.h>
#pragma GCC optimize("O3")
#pragma GCC optimize("Ofast")
using namespace std;
const int N = 300003, mod = 998244353;
const long long inf = (1e18 + 11);
long long fact[N];
multiset<int> ls;
map<int, int> rs;
long long power(long long b, int p) {
  long long r = 1;
  b %= mod;
  while (p) {
    if (p & 1) r *= b, r %= mod;
    b *= b, b %= mod;
    p >>= 1;
  }
  return r;
}
long long modinv(long long x) { return power(x, mod - 2); }
long long C(int n, int r) {
  if (n < r) return 0;
  return ((fact[n] * modinv(fact[r] * fact[n - r])) % mod);
}
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n, k;
  cin >> n >> k;
  int i, j, l, r;
  fact[0] = 1;
  for (i = 1; i <= n; ++i) fact[i] = (fact[i - 1] * i) % mod;
  ls.clear(), rs.clear();
  for (i = 1; i <= n; ++i) cin >> l >> r, ls.insert(l), rs[r + 1]++;
  int prev = 0;
  for (auto it : rs) rs[it.first] += prev, prev = rs[it.first];
  int cnt = 0, ans = 0;
  for (auto it : ls) {
    ++cnt;
    auto it1 = rs.upper_bound(it);
    if (it1 == rs.begin()) {
      if (cnt >= k) {
        ans += C(cnt - 1, k - 1);
        if (ans >= mod) ans -= mod;
      }
    } else {
      auto it2 = it1;
      --it2;
      cnt -= it2->second;
      if (cnt >= k) {
        ans += C(cnt - 1, k - 1);
        if (ans >= mod) ans -= mod;
      }
      cnt += it2->second;
    }
  }
  cout << ans;
  return 0;
}
