#include <bits/stdc++.h>
using namespace std;
const long long MOD2 = 1000 * 1000 * 1000 + 7;
const long long INF = 1ll * 1000 * 1000 * 1000 * 1000 * 1000 * 1000 + 7;
const long long MOD = 998244353;
const long long N = 1000 * 100 + 10;
const long long N2 = 70;
const long double PI = 3.141592653589793;
long long gcd(long long a, long long b) {
  if (!b) return a;
  return gcd(b, a % b);
}
long long power(long long x, long long y, long long p = LLONG_MAX) {
  long long res = 1;
  x %= p;
  while (y > 0) {
    if (y & 1) res = (res * x) % p;
    y = y >> 1;
    x = (x * x) % p;
  }
  return res;
}
long long lcm(long long a, long long b) { return (a * b) / gcd(a, b); }
long long inv(long long val, long long MODx = MOD) {
  return power(val, MODx - 2, MODx);
}
vector<long long> fac, ifac;
void preFac(long long sz) {
  fac.resize(sz + 1), ifac.resize(sz + 1);
  fac[0] = 1;
  for (long long i = 1; i <= sz; i++) {
    fac[i] = (i * fac[i - 1]) % MOD;
  }
  ifac[sz] = inv(fac[sz]);
  for (long long i = sz - 1; i >= 0; i--) {
    ifac[i] = ((i + 1) * ifac[i + 1]) % MOD;
  }
}
long long nCr(long long N, long long R) {
  if (R <= N && R >= 0) {
    return ((fac[N] * ifac[R]) % MOD * ifac[N - R]) % MOD;
  }
  return 0;
}
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long n, k;
  cin >> n >> k;
  std::vector<pair<long long, long long> > v(n);
  for (long long i = 0; i < n; ++i) {
    cin >> v[i].first >> v[i].second;
  }
  sort(v.begin(), v.end());
  preFac(n + 10);
  long long ans = 0;
  multiset<long long> store;
  for (long long i = 0; i < n; ++i) {
    while (!store.empty() && (*store.begin() < v[i].first)) {
      store.erase(store.begin());
    }
    ans += (nCr((long long)store.size(), k - 1));
    ans += MOD;
    ans %= MOD;
    store.insert(v[i].second);
  }
  cout << ans << "\n";
  cerr << "Time : " << 1000 * (long double)clock() / (long double)CLOCKS_PER_SEC
       << "ms\n";
  ;
  return 0;
}
