#include <bits/stdc++.h>
using namespace std;
class COMBCALC {
 private:
  static constexpr int maxN = 3e5;
  static constexpr int mod = 998244353;
  vector<int> inv;
  vector<int> fact;
  vector<int> fact_inv;

 public:
  COMBCALC() : inv(1 + maxN, 0), fact(1 + maxN, 0), fact_inv(1 + maxN, 0) {
    inv[1] = 1;
    for (int k = 2; k <= maxN; ++k)
      inv[k] = (int)((long long)(mod - mod / k) * inv[mod % k] % mod);
    fact[0] = 1;
    fact_inv[0] = 1;
    for (int k = 1; k <= maxN; ++k) {
      fact[k] = (int)((long long)fact[k - 1] * k % mod);
      fact_inv[k] = (int)((long long)fact_inv[k - 1] * inv[k] % mod);
    }
  }
  int operator()(int N, int K) {
    if (K < 0 || K > N) return 0;
    return (int)(((long long)fact[N] * fact_inv[K] % mod) * fact_inv[N - K] %
                 mod);
  }
} C;
long long lampopen(const vector<pair<int, int> >& L, int K) {
  constexpr int mod = 998244353;
  map<int, pair<int, int> > LM;
  for (const pair<int, int>& p : L) {
    map<int, pair<int, int> >::iterator it;
    it = LM.find(p.first);
    if (it != LM.end())
      it->second.first++;
    else
      LM[p.first] = {1, 0};
    it = LM.find(p.second);
    if (it != LM.end())
      it->second.second++;
    else
      LM[p.second] = {0, 1};
  }
  int on = 0;
  long long ans = 0;
  for (auto it = LM.begin(); it != LM.end(); ++it) {
    const auto& p = it->second;
    ans = (ans + C(on + p.first, K) - C(on, K) + mod) % mod;
    on += p.first - p.second;
  }
  return ans;
}
int main() {
  int N, K;
  scanf("%d%d", &N, &K);
  vector<pair<int, int> > L(N);
  for (int k = 0; k < N; ++k) scanf("%d%d", &L[k].first, &L[k].second);
  printf("%lld\n", lampopen(L, K));
}
