#include <bits/stdc++.h>
using namespace std;
const double eps = 1e-7;
const long long int N = 5e5 + 7, mod = 998244353;
long long int POW(long long int a, long long int b, long long int mod) {
  a %= mod;
  long long int r = 1;
  for (long long int i = b; i > 0; i >>= 1) {
    if (i & 1) r = (r * a) % mod;
    a = (a * a) % mod;
  }
  return r;
}
long long int f[N];
long long int nCr(long long int n, long long int r) {
  if (n < r) return 0;
  return f[n] * POW(f[n - r] * f[r], mod - 2, mod) % mod;
}
long long int nPr(long long int n, long long int r) {
  return nCr(n, r) * f[r] % mod;
}
int main() {
  f[0] = 1;
  for (long long int i = 1; i < N; i++) {
    f[i] = (f[i - 1] * i) % mod;
  }
  long long int n, k;
  cin >> n >> k;
  set<long long int> x;
  map<long long int, long long int> mp;
  vector<long long int> a, b;
  for (long long int i = 0; i < n; i++) {
    long long int l, r;
    cin >> l >> r;
    a.push_back(l);
    b.push_back(r);
    mp[l]++;
    x.insert(l);
  }
  sort(a.begin(), a.end());
  sort(b.begin(), b.end());
  long long int ans = 0;
  for (long long int j : x) {
    long long int p, s;
    p = n;
    long long int z = lower_bound(b.begin(), b.end(), j) - b.begin();
    long long int z1 = upper_bound(a.begin(), a.end(), j) - a.begin();
    z1 = n - z1;
    p -= z1 + z;
    s = mp[j];
    ans = (ans + nCr(p, k));
    long long int tem = nCr((p - s), k);
    ans = (ans + mod - tem) % mod;
  }
  cout << ans << "\n";
}
