#include <bits/stdc++.h>
using namespace std;
const double pi = 3.141592653;
const long long infi = 1000000001;
const long long mod = 998244353;
const string no = "NO\n", yes = "YES\n";
long long bexpo(long long a, long long p) {
  long long x = 1;
  while (p) {
    if (p & 1) {
      x = (x * a) % mod;
    }
    a = (a * a) % mod;
    p >>= 1;
  }
  return x;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  int t = 1;
  long long n, m, i, length, d, bank, k, j, x, y, ans, q;
  while (t--) {
    ans = 0;
    cin >> n >> k;
    vector<pair<long long, long long> > vp;
    for (i = 0; i < n; i++) {
      cin >> x >> y;
      vp.emplace_back(make_pair(x, y));
    }
    long long fact[n + 1], inv[n + 1];
    fact[0] = 1;
    for (i = 1; i < n + 1; i++) {
      fact[i] = (fact[i - 1] * i) % mod;
    }
    inv[n] = bexpo(fact[n], mod - 2);
    for (i = n - 1; i >= 0; i--) {
      inv[i] = ((i + 1) * inv[i + 1]) % mod;
    }
    priority_queue<long long, vector<long long>, greater<long long> > pq;
    sort(vp.begin(), vp.end());
    x = 0;
    for (i = 0; i < n; i++) {
      pq.push(vp[i].second);
      y = vp[i].first;
      while (pq.top() < y && !pq.empty()) {
        pq.pop();
      }
      x = pq.size();
      y = 0;
      if (x >= k) {
        y = (((fact[x - 1] * inv[k - 1]) % mod) * inv[x - k]) % mod;
        ans += (((fact[x - 1] * inv[k - 1]) % mod) * inv[x - k]) % mod;
        ans %= mod;
      }
    }
    cout << ans;
  }
  return 0;
}
