#include <bits/stdc++.h>
using namespace std;
long long m = 998244353;
long long n, k;
vector<vector<long long>> seg(n, vector<long long>(2, 0));
vector<long long> val;
vector<long long> cnt(val.size(), 0);
long long bin(long long a, long long b) {
  if (b == 0) return 1;
  long long u = bin(a, b / 2);
  u = (u * u) % m;
  if (b % 2 == 1) return (u * a) % m;
  return u;
}
vector<long long> fact;
long long divMod(long long a, long long b) { return a * bin(b, m - 2) % m; }
long long cnk(long long a, long long p) {
  long long b = fact[p] * fact[a - p] % m;
  long long x = divMod(fact[a], b);
  return x;
}
void init() {
  fact.assign(1e6 + 1, 1);
  for (long long i = 1; i < 1e6; i++) fact[i] = (fact[i - 1] * i) % m;
}
int main() {
  cin >> n >> k;
  seg.assign(n, vector<long long>(2, 0));
  for (long long i = 0; i < n; i++) cin >> seg[i][0] >> seg[i][1];
  sort(seg.begin(), seg.end());
  init();
  vector<int> val;
  for (int i = 0; i < n; i++) val.push_back(seg[i][0]);
  auto last = unique(val.begin(), val.end());
  val.erase(last, val.end());
  long long ans = 0;
  vector<int> cnt(val.size(), 0);
  for (int i = 0; i < n; i++) {
    int a = lower_bound(val.begin(), val.end(), seg[i][0]) - val.begin();
    int b = upper_bound(val.begin(), val.end(), seg[i][1]) - val.begin() - 1;
    cnt[a]++;
    if (b < val.size() - 1) cnt[b + 1]--;
  }
  for (int i = 1; i < val.size(); i++) cnt[i] += cnt[i - 1];
  vector<int> amount(val.size(), 0);
  for (int i = 0; i < n; i++)
    amount[lower_bound(val.begin(), val.end(), seg[i][0]) - val.begin()]++;
  for (int i = 0; i < val.size(); i++) {
    if (cnt[i] < k) continue;
    long long res = cnk(cnt[i], k);
    if (cnt[i] - amount[i] >= k) res -= cnk(cnt[i] - amount[i], k);
    if (res < 0) res += m;
    ans += res;
    ans %= m;
  }
  cout << ans << endl;
}
