#include <bits/stdc++.h>
const long long mod = 1000 * 1000 * 1000 + 7;
const long long mod1 = 998244353;
const long long INF = 1ll * 1000 * 1000 * 1000 * 1000 * 1000 * 1000 + 7;
using namespace std;
long long power(long long x, long long y, long long p) {
  long long res = 1;
  x = x % p;
  while (y > 0) {
    if (y & 1) res = (res * x) % p;
    y = y / 2;
    x = (x * x) % p;
  }
  return res;
}
long long modInverse(long long n, long long p) { return power(n, p - 2, p); }
long long fact[300005] = {};
long long nCr(long long n, long long r, long long p) {
  return (fact[n] * modInverse(fact[r], p) % p * modInverse(fact[n - r], p) %
          p) %
         p;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  vector<pair<long long, long long> > swp;
  long long n, k;
  cin >> n >> k;
  for (int(i) = (0); (i) < (n); ++(i)) {
    long long x, y;
    cin >> x >> y;
    swp.push_back({x, 0});
    swp.push_back({y, 1});
  }
  sort(swp.begin(), swp.end());
  long long sum = 0;
  long long cnt = 0;
  fact[0] = 1;
  for (long long i = 1; i <= 300005; i++) {
    fact[i] = i * fact[i - 1];
    fact[i] %= mod1;
  }
  for (int i = 0; i < int((swp).size()); i++) {
    if (swp[i].second == 0) {
      if (cnt >= k - 1) sum += nCr(cnt, k - 1, mod1);
      sum %= mod1;
      cnt += 1;
    } else {
      cnt -= 1;
    }
  }
  cout << sum % mod1;
  return 0;
}
