#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using matr = vector<vector<ll>>;
using dbl = long double;
using ui = unsigned int;
mt19937 rnd;
ll random(ll limit) {
  uniform_int_distribution<ll> uniform_dist(0, limit);
  return uniform_dist(rnd);
}
ll solve(vector<ll> x, ll k) {
  ll n = x.size();
  if (k == 0) return n * (n - 1) / 2;
  vector<ll> y;
  ll num = 0;
  for (int i = 0; i < n; i++) {
    if (x[i] < k)
      y.push_back(x[i]);
    else
      num++;
  }
  return num * (num - 1) / 2 + solve(y, k / 2);
}
ll mod = 998244353;
ll bpow(ll a, ll b) {
  ll res = 1;
  while (b > 0) {
    if (b % 2) res *= a;
    a *= a;
    b /= 2;
    a %= mod;
    res %= mod;
  }
  return res;
}
ll inv(ll a) { return (bpow(a, mod - 2)); }
int N = 3E5;
vector<ll> fac(2 * N + 1);
ll bin(ll n, ll k) {
  if (k > n) return 0;
  ll res = fac[n];
  res *= inv(fac[k]);
  res %= mod;
  res *= inv(fac[n - k]);
  res %= mod;
  return res;
}
int main() {
  rnd = mt19937(956231);
  ios::sync_with_stdio(false);
  cin.tie(0);
  fac[0] = 1;
  for (int i = 0; i < 2 * N; i++) {
    fac[i + 1] = fac[i] * (i + 1);
    fac[i + 1] %= mod;
  }
  ll n, k;
  cin >> n >> k;
  vector<vector<ll>> kek;
  for (int i = 0; i < n; i++) {
    ll l, r;
    cin >> l >> r;
    kek.push_back({l, 1});
    kek.push_back({r, 2});
  }
  sort(kek.begin(), kek.end());
  ll ans = 0;
  int num = 0;
  for (auto v : kek) {
    if (v[1] == 1) {
      num++;
      ans += bin(num, k) - bin(num - 1, k);
      ans %= mod;
      ans += mod;
      ans %= mod;
    } else
      num--;
  }
  cout << ans;
}
