#include <bits/stdc++.h>
using namespace std;
const long long inf = 1e18;
const int32_t mod = 998244353;
const long long N = 3e5 + 50;
long long fact[N], invfact[N];
long long powerM(long long a, long long b) {
  long long ans = 1;
  while (b) {
    if (b & 1) ans = (ans * a) % mod;
    b /= 2;
    a = (a * a) % mod;
  }
  return ans;
}
long long invM(long long num) { return powerM(num, mod - 2); }
void precompute() {
  fact[0] = fact[1] = 1;
  for (long long i = 2; i < N; i++) {
    fact[i] = fact[i - 1] * i;
    fact[i] %= mod;
  }
  invfact[N - 1] = invM(fact[N - 1]);
  for (long long i = N - 2; i >= 0; i--) {
    invfact[i] = invfact[i + 1] * (i + 1);
    invfact[i] %= mod;
  }
}
long long nCr(long long x, long long y) {
  if (y > x) return 0;
  long long num = fact[x];
  num *= invfact[y];
  num %= mod;
  num *= invfact[x - y];
  num %= mod;
  return num;
}
long long n, k;
long long solve() {
  precompute();
  cin >> n >> k;
  map<long long, vector<long long>> mp;
  for (long long i = 0; i < n; i++) {
    long long x, y;
    cin >> x >> y;
    mp[x].push_back(1);
    mp[y + 1].push_back(-1);
  }
  long long cur = 0;
  long long las = (*mp.begin()).first;
  long long ans = 0;
  for (auto& i : mp) {
    long long sum = 0;
    for (auto& j : i.second) {
      if (j == -1)
        cur--;
      else
        sum++;
    }
    for (long long ii = 1; ii <= min(sum, k); ii++) {
      if (k - ii > cur) continue;
      ans += nCr(sum, ii) * nCr(cur, k - ii) % mod;
      ans %= mod;
    }
    cur += sum;
  }
  cout << ans << '\n';
  return 0;
}
signed main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cout << fixed << setprecision(20);
  long long tests = 1;
  for (long long i = 1; i <= tests; i++) {
    solve();
  }
  return 0;
}
