#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vi = vector<int>;
using pi = pair<int, int>;
const int mod = 998244353;
const ll inf = ll(1e18);
const double PI = acos(-1), eps = 1e-9;
ll fast_pow(int a, int p) {
  ll res = 1;
  while (p) {
    if (p % 2 == 0) {
      a = a * 1ll * a % mod;
      p /= 2;
    } else {
      res = res * 1ll * a % mod;
      p--;
    }
  }
  return res;
}
ll fact[300005] = {1};
ll c(int n, int k) {
  return fact[n] * 1ll * fast_pow(fact[k], mod - 2) % mod * 1ll *
         fast_pow(fact[n - k], mod - 2) % mod;
}
const int mxa = 2e5;
const int mxn = 2e5, mxk = 5e2 + 5;
int n, k;
void solve() {
  cin >> n >> k;
  map<int, pi> make_pair;
  for (int i = 0; i < n; ++i) {
    int l, r;
    cin >> l >> r;
    ++make_pair[l].first;
    ++make_pair[r + 1].second;
  }
  for (int i = 1; i <= n; ++i) fact[i] = (fact[i - 1] * i) % mod;
  ll ans = 0;
  int cnt = 0;
  for (const auto &p : make_pair) {
    cnt += (p.second.first - p.second.second);
    if (cnt >= k) {
      ans = (ans + c(cnt, k)) % mod;
      if (cnt - p.second.first >= k)
        ans = ((ans - c(cnt - p.second.first, k)) % mod + mod) % mod;
    }
  }
  cout << ans << '\n';
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int tt;
  tt = 1;
  while (tt-- > 0) solve();
}
