#include <bits/stdc++.h>
using namespace std;
long long powmod(long long a, long long b) {
  long long res = 1;
  assert(b >= 0);
  for (; b; b >>= 1) {
    if (b & 1) res = res * a;
    a = a * a;
  }
  return res;
}
long long gcd(long long a, long long b) { return b ? gcd(b, a % b) : a; }
const int mod = 998244353;
vector<long long> fac, facinv;
long long nCk(int n, int k) {
  if (k > n) return 0ll;
  long long ans = fac[n] * facinv[k] % mod;
  ans = ans * facinv[n - k] % mod;
  return ans % mod;
}
void factorial(int n) {
  fac.resize(n + 1);
  facinv.resize(n + 1);
  vector<long long> inv(n + 1);
  fac[0] = 1;
  inv[0] = 1;
  facinv[0] = 1;
  fac[1] = 1;
  inv[1] = 1;
  facinv[1] = 1;
  for (int i = 2; i <= n; ++i) {
    inv[i] = (mod - (mod / i) * inv[mod % i] % mod) % mod;
    fac[i] = fac[i - 1] * i % mod;
    facinv[i] = (facinv[i - 1] * inv[i]) % mod;
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long n, k, l, r;
  cin >> n >> k;
  factorial(400000);
  vector<pair<int, int> > v;
  for (int i = 0; i < n; ++i) {
    cin >> l >> r;
    v.push_back({l, 1});
    v.push_back({r + 1, -1});
  }
  sort(v.begin(), v.end());
  long long ans = 0, s = 0;
  for (int i = 0; i < v.size(); ++i) {
    pair<int, int> x = v[i];
    s += x.second;
    ans = (ans + max(x.second, 0) * 1ll * nCk(s - 1, k - 1)) % mod;
  }
  cout << ans << '\n';
  return 0;
}
