#include <bits/stdc++.h>
using namespace std;
long long mod = 998244353;
long long N = 100311;
long long fact[300005], inv[300005];
long long inverse(long long a) {
  long long ret = 1;
  for (long long b = mod - 2; b > 0; b /= 2) {
    if (b % 2) ret = ret * a % mod;
    a = a * a % mod;
  }
  return ret;
}
long long C(long long n, long long k) {
  if (n < k) return 0;
  return fact[n] * inv[k] % mod * inv[n - k] % mod;
}
long long binpow(long long x, long long y) {
  if (y == 0) return 1;
  if (y == 1)
    return x % mod;
  else if (y % 2 == 0) {
    long long w = binpow(x, y / 2) % mod;
    return (w * w) % mod;
  } else
    return ((x % mod) * (binpow(x, y - 1) % mod)) % mod;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long t = 1;
  while (t--) {
    long long n, k;
    cin >> n >> k;
    vector<pair<long long, long long>> v;
    for (long long i = 1; i <= n; i++) {
      long long l, r;
      cin >> l >> r;
      v.push_back({l, 1});
      v.push_back({r + 1, -1});
    }
    fact[0] = inv[0] = 1;
    for (int i = 1; i <= n; i++) {
      fact[i] = fact[i - 1] * i % mod;
      inv[i] = inverse(fact[i]);
    }
    sort(v.begin(), v.end());
    long long ans = 0;
    long long total = 0, nw = 0;
    for (long long i = 0; i < 2 * n; i++) {
      if (v[i].second == -1)
        total--;
      else {
        total++;
        nw++;
      }
      nw = min(nw, total);
      if (total >= k) {
        ans += (C(total, k) - C(total - nw, k) + mod);
        ans %= mod;
        nw = 0;
      }
    }
    cout << ans % mod;
  }
}
