#include <bits/stdc++.h>
using namespace std;
const long long N = 3 * 1e5 + 5, mod = 998244353;
map<pair<long long, long long>, long long> mp;
long long fact[400005];
long long power(long long a, long long b) {
  long long res = 1;
  while (b > 0) {
    if (b & 1) {
      res = ((res % mod) * (a % mod)) % mod;
    }
    a = ((a % mod) * (a % mod)) % mod;
    b = (b >> 1) % mod;
  }
  return res % mod;
}
void precompute() {
  fact[0] = 1;
  for (long long i = 1; i <= 400003; i++) {
    fact[i] = (fact[i - 1] * i) % mod;
  }
}
long long ncr(long long n, long long k) {
  long long num = fact[n] % mod;
  long long den1 = power(fact[k], mod - 2);
  long long den2 = power(fact[n - k], mod - 2);
  long long den = (den1 * den2) % mod;
  return (num * den) % mod;
}
int32_t main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  long long n, k, l, r;
  precompute();
  cin >> n >> k;
  for (long long i = 0; i < n; i++) {
    cin >> l >> r;
    mp[make_pair(l, -1)] += 1;
    mp[make_pair(r, 1)] += 1;
  }
  long long an = 0, pr = 0;
  for (auto i : mp) {
    auto pt = i.first;
    r = i.second;
    if (pt.second == -1) {
      for (long long x = 1; x <= r; x++)
        if (pr + x >= k) an = (an + ncr(pr + x - 1, k - 1)) % mod;
    }
    pr += -pt.second * r;
  }
  an = (an + mod) % mod;
  cout << an;
}
