#include <bits/stdc++.h>
using namespace std;
const long long N = 3e5 + 9, mod = 998244353;
vector<long long> fac(N), invfac(N);
long long power(long long x, long long p) {
  long long res = 1;
  x %= mod;
  if (!x) return x;
  while (p) {
    if (p % 2) res = (res * x) % mod;
    p >>= 1;
    x = (x * x) % mod;
  }
  return res;
}
void preprocess() {
  fac[0] = fac[1] = 1;
  for (long long i = 2; i < N; i++) {
    fac[i] = (fac[i - 1] * i) % mod;
  }
  invfac[N - 1] = power(fac[N - 1], mod - 2);
  for (long long i = N - 2; i >= 0; i--) {
    invfac[i] = (invfac[i + 1] * (i + 1)) % mod;
  }
}
long long nCr(long long n, long long r) {
  if (r > n) return 0;
  long long ans = (fac[n] * ((invfac[r] * invfac[n - r]) % mod)) % mod;
  return ans;
}
int32_t main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  preprocess();
  long long n, k;
  cin >> n >> k;
  vector<pair<long long, long long> > seg;
  for (long long i = 1; i <= n; i++) {
    long long l, r;
    cin >> l >> r;
    seg.push_back({l, i});
    seg.push_back({r + 1, -i});
  }
  sort(seg.begin(), seg.end());
  multiset<long long> cur;
  long long ans = 0;
  for (long long i = 0; i < 2 * n; i++) {
    long long j = seg[i].second;
    if (j < 0)
      cur.erase(-j);
    else {
      cur.insert(j);
      if (cur.size() >= k) {
        ans += nCr(cur.size() - 1, k - 1);
        ans %= mod;
      }
    }
  }
  cout << ans << '\n';
  return 0;
}
