#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
using namespace std;
const long long N = 3e5 + 10, alp = 26;
const long double pi = 3.14159265358979;
long long mod = 998244353;
long long fact[N];
long long binpow(long long a, long long n) {
  if (!n) return 1;
  long long k = binpow(a, n / 2);
  k = (k * k) % mod;
  if (n & 1) k = (k * a) % mod;
  return k;
}
long long cnk(long long n, long long k) {
  if (k > n) return 0;
  return (fact[n] * binpow((fact[n - k] * fact[k]) % mod, mod - 2)) % mod;
}
void solve() {
  fact[0] = fact[1] = 1;
  for (long long i = 2; i < N; ++i) fact[i] = (fact[i - 1] * i) % mod;
  long long n, k, res = 0;
  cin >> n >> k;
  vector<pair<pair<long long, long long>, long long>> s;
  for (long long i = 0; i < n; ++i) {
    long long l, r;
    cin >> l >> r;
    s.push_back({{l, 0}, i});
    s.push_back({{r, 1}, i});
  }
  sort(s.begin(), s.end());
  set<long long> curr;
  for (auto to : s) {
    if (to.first.second == 1) {
      curr.erase(to.second);
    } else {
      res += cnk(curr.size(), k - 1);
      res %= mod;
      curr.insert(to.second);
    }
  }
  cout << res;
}
int32_t main() {
  ios_base::sync_with_stdio(NULL);
  cin.tie(0);
  cout.tie(0);
  long long t = 1;
  while (t--) solve();
}
