#include <bits/stdc++.h>
using namespace std;
const long long int mod = 998244353;
const long long int inf = 2e9 + 5;
double PI = 3.14159265358979323846;
const int N = 3e5 + 7;
long long int modexp(long long int x, long long int n) {
  long long int ans = 1;
  while (n) {
    if (n & 1) ans = ans * x % mod;
    x = x * x % mod;
    n /= 2;
  }
  return ans;
}
long long int modinv(long long int x) { return modexp(x, mod - 2); }
long long int fact[N];
void pre() {
  fact[0] = 1;
  for (int i = 1; i < N; i++) fact[i] = i * fact[i - 1] % mod;
}
long long int C(int n, int k) {
  if (k < 0 || k > n) return 0;
  long long int num = fact[n];
  long long int dem = fact[k] * fact[n - k] % mod;
  return num * modinv(dem) % mod;
}
template <long long int M>
struct ModInt {
  int val;
  ModInt(long long int x = 0) : val((x % M + M) % M) {}
  ModInt pow(long long int n) const {
    ModInt ans = 1, x = val;
    while (n) {
      if (n & 1) ans *= x;
      x *= x;
      n /= 2;
    }
    return ans;
  }
  ModInt inverse() const { return pow(M - 2); }
  ModInt operator+(const ModInt& m) {
    return val + m.val < M ? val + m.val : val + m.val - M;
  }
  ModInt operator-(const ModInt& m) {
    return val - m.val >= 0 ? val - m.val : val - m.val + M;
  }
  ModInt operator*(const ModInt& m) { return val * (long long int)m.val % M; }
  ModInt operator/(const ModInt& m) { return *this * m.inverse(); }
  ModInt operator+=(const ModInt& m) { return *this = *this + m; }
  ModInt operator-=(const ModInt& m) { return *this = *this - m; }
  ModInt operator*=(const ModInt& m) { return *this = *this * m; }
  ModInt operator/=(const ModInt& m) { return *this = *this / m; }
  friend ostream& operator<<(ostream& os, const ModInt& m) {
    os << m.val;
    return os;
  }
  friend istream& operator>>(istream& is, ModInt& m) {
    is >> m.val;
    return is;
  }
};
using mint = ModInt<mod>;
void solve() {
  long long int n, k;
  cin >> n >> k;
  vector<long long int> l(n), r(n);
  for (int i = 0; i < n; i++) {
    cin >> l[i] >> r[i];
  }
  vector<long long int> order(n);
  iota((order).begin(), (order).end(), 0);
  sort((order).begin(), (order).end(),
       [&](long long int i, long long int j) { return l[i] < l[j]; });
  pre();
  mint ans = 0;
  multiset<long long int> s;
  for (long long int i : order) {
    while (!s.empty() and (*s.begin()) < l[i]) {
      s.erase(s.begin());
    }
    long long int cnt = (long long int)s.size();
    ans += C(cnt, k - 1);
    s.insert(r[i]);
  }
  cout << ans << "\n";
}
int32_t main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  solve();
  return 0;
}
