#include <bits/stdc++.h>
#pragma GCC optimize "trapv"
using namespace std;
long long int fac[300005 + 1];
long long int power(long long int x, long long int y) {
  long long int res = 1;
  x = x % 998244353;
  while (y > 0) {
    if (y & 1) res = (res * x) % 998244353;
    y = y >> 1;
    x = (x * x) % 998244353;
  }
  return res;
}
long long int modInverse(long long int n) { return power(n, 998244353 - 2); }
long long int nCrModPFermat(long long int n, long long int r) {
  if (r == 0) return 1;
  return (fac[n] * modInverse(fac[r]) % 998244353 * modInverse(fac[n - r]) %
          998244353) %
         998244353;
}
bool cmp(const pair<long long int, long long int>& a,
         const pair<long long int, long long int>& b) {
  if (a.first != b.first) {
    return a.first < b.first;
  } else {
    return a.second > b.second;
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  ;
  long long int t = 1;
  fac[0] = 1;
  for (int i = 1; i <= 300005; i++) fac[i] = (fac[i - 1] * i) % 998244353;
  while (t--) {
    long long int n, k;
    cin >> n >> k;
    vector<pair<long long int, long long int>> v;
    for (long long int i = 0; i < n; i++) {
      long long int x, y;
      cin >> x >> y;
      v.push_back({x, 1});
      v.push_back({y, 0});
    }
    sort(v.begin(), v.end(), cmp);
    long long int on = 0, ans = 0;
    for (long long int i = 0; i < v.size(); i++) {
      if (v[i].second == 1) {
        if (on >= k - 1) {
          ans = (ans + nCrModPFermat(on, k - 1)) % 998244353;
        }
        on++;
      } else {
        on--;
      }
    }
    cout << ans << endl;
  }
  return 0;
}
