#include <bits/stdc++.h>
using namespace std;
long long int powerFunction(long long int x, long long int y) {
  long long int res = 1;
  long long int p = 998244353;
  x = x % p;
  while (y > 0) {
    if (y & 1) res = (res * x) % p;
    y = y >> 1;
    x = (x * x) % p;
  }
  return res;
}
bool prime[10000001];
long long int P = 998244353 - 2;
long long int fact[10000001] = {0};
void sieveFunction(long long int maxLimit) {
  memset(prime, true, sizeof(prime));
  prime[0] = prime[1] = false;
  for (long long int i = 2; maxLimit >= i; i++) {
    if (prime[i]) {
      for (long long int j = 2 * i; maxLimit >= j; j += i) prime[j] = false;
    }
  }
}
void factorialFunction(long long int maxLimit) {
  fact[0] = 1;
  for (long long int i = 1; i <= maxLimit; i++)
    fact[i] = (fact[i - 1] * i) % 998244353;
  return;
}
long long int nCr(long long int n, long long int r) {
  long long int a = fact[n];
  long long int b = powerFunction(fact[n - r], 998244353 - 2);
  long long int c = powerFunction(fact[r], 998244353 - 2);
  return (a * (b % 998244353 * c % 998244353) % 998244353) % 998244353;
}
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long int n, k;
  cin >> n >> k;
  map<long long int, long long int> m, s, st;
  factorialFunction(n + 1);
  for (long long int i = 0; i < n; i++) {
    long long int l, r;
    cin >> l >> r;
    m[l]++;
    m[r + 1]--;
    st[l]++;
  }
  long long int pre = INT_MIN;
  for (auto it : m) {
    s[it.first] = it.second;
    if (pre == INT_MIN) {
      pre = it.second;
      continue;
    }
    s[it.first] += pre;
    pre = s[it.first];
  }
  pre = INT_MIN;
  long long int ans = 0;
  for (auto it : st) {
    if (s[it.first] < k) continue;
    ans += nCr(s[it.first], k);
    ans %= 998244353;
    if (s[it.first] - it.second >= k) ans -= nCr(s[it.first] - it.second, k);
    ans += 998244353;
    ans %= 998244353;
  }
  cout << ans << "\n";
}
