#include <bits/stdc++.h>
using namespace std;
long long fact[300005];
long long mod = 998244353;
bool omp(pair<int, int> a, pair<int, int> b) {
  if (a.first < b.first) return 1;
  if (a.first > b.first) return 0;
  if (a.second > b.second) return 1;
  return 0;
}
long long power(long long a, long long b) {
  long long res = 1;
  while (b > 0) {
    if (b & 1) res = (res * a) % mod;
    a = (a * a) % mod;
    b = b >> 1;
  }
  return res;
}
long long mod_inverse(long long a) { return power(a, mod - 2); }
long long ncr(long long a, long long b) {
  if (b == 0) return 1;
  if (b == 1) return a % mod;
  return ((fact[a] * mod_inverse(fact[a - b])) % mod * mod_inverse(fact[b])) %
         mod;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long t = 1;
  fact[0] = fact[1] = 1;
  for (long long i = 1; i <= 300002; i++) {
    fact[i] = (fact[i - 1] * i) % mod;
  }
  int n, k;
  cin >> n >> k;
  vector<pair<int, int>> arr(2 * n);
  for (int i = 0; i < arr.size(); i += 2) {
    cin >> arr[i].first >> arr[i + 1].first;
    arr[i].second = 1;
    arr[i + 1].second = 0;
  }
  sort(arr.begin(), arr.end(), omp);
  long long count = 0;
  long long on = 0;
  for (int i = 0; i < arr.size(); i++) {
    if (arr[i].second == 1) {
      if (on >= k - 1) {
        count = (count + ncr(on, k - 1)) % mod;
      }
      on++;
    } else {
      on--;
    }
  }
  cout << count << '\n';
  return 0;
}
