#include <bits/stdc++.h>
using namespace std;
long long int inv[300005 + 3];
long long int fact_inv[300005 + 3];
long long int fact[300005 + 3];
void inverse() {
  inv[1] = 1;
  int i;
  for (i = 2; i <= 300005; i++) {
    inv[i] = 998244353 - (998244353 / i) * inv[998244353 % i] % 998244353;
  }
}
void factinv() {
  int i;
  fact_inv[0] = 1;
  for (i = 1; i <= 300005; i++) {
    fact_inv[i] = fact_inv[i - 1] * inv[i] % 998244353;
  }
}
void facto() {
  int i;
  fact[0] = 1;
  for (i = 1; i <= 300005; i++) {
    fact[i] = (fact[i - 1] * i) % 998244353;
  }
}
long long int count(long long int n, long long int k) {
  if (k > n)
    return 0LL;
  else
    return (((fact[n] * fact_inv[max(n - k, 0LL)]) % 998244353) * fact_inv[k]) %
           998244353;
}
int main(void) {
  {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
  };
  inverse();
  factinv();
  facto();
  long long int n, i, k, bal = 0, ans = 0, x, y;
  cin >> n >> k;
  vector<pair<long long int, long long int>> v;
  for (i = 0; i < n; i++) {
    cin >> x >> y;
    ++y;
    v.push_back({x, 1});
    v.push_back({y, -1});
  }
  sort(v.begin(), v.end());
  for (auto x : v) {
    if (x.second == 1) {
      ans += count(bal, k - 1);
      ans %= 998244353;
      ++bal;
    } else
      --bal;
  }
  cout << ans;
}
