#include <bits/stdc++.h>
using namespace std;
#pragma warning(disable : 4996)
const long long MOD = 998244353;
long long fact[1000000];
long long binpow(long long a, long long p) {
  if (p == 0) return 1;
  long long res = binpow(a, p / 2);
  res *= res;
  res %= MOD;
  if (p % 2) res *= a;
  res %= MOD;
  return res;
}
long long C(long long n, long long k) {
  long long c = fact[n];
  c *= binpow(fact[k], MOD - 2);
  c %= MOD;
  c *= binpow(fact[n - k], MOD - 2);
  c %= MOD;
  return c;
}
void solve() {
  long long n, k;
  cin >> n >> k;
  vector<pair<long long, long long>> points;
  for (long long i = 0; i < n; i++) {
    long long l, r;
    cin >> l >> r;
    points.push_back({l, 1});
    points.push_back({r + 1, -1});
  }
  sort(points.begin(), points.end());
  long long bal = 0;
  long long res = 0;
  for (long long i = 0; i < points.size(); i++) {
    if (points[i].second == 1) {
      if (bal > k - 1) {
        res -= C(bal, k);
        res %= MOD;
        if (res < 0) res += MOD;
      }
      bal++;
      if (bal >= k) res += C(bal, k);
      res %= MOD;
      if (res < 0) res += MOD;
    } else
      bal--;
  }
  cout << res;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  srand(time(0));
  fact[0] = 1;
  for (long long i = 1; i < 1000000; i++)
    fact[i] = ((fact[i - 1] % MOD) * (i % MOD)) % MOD;
  long long t = 1;
  while (t--) {
    solve();
    cout << "\n";
  }
  return 0;
}
