#include <bits/stdc++.h>
using namespace std;
const int maxn = 6e5 + 4;
const int mod = 998244353;
int l[maxn], r[maxn];
pair<int, int> p[maxn];
long long fac[maxn];
long long inv[maxn];
long long qk(long long a, long long n) {
  long long res = 1;
  while (n) {
    if (n & 1) res = res * a % mod;
    n >>= 1;
    a = a * a % mod;
  }
  return res;
}
void init() {
  fac[0] = 1;
  for (int i = 1; i < maxn; ++i) {
    fac[i] = fac[i - 1] * i % mod;
  }
  inv[maxn - 1] = qk(fac[maxn - 1], mod - 2);
  for (int i = maxn - 2; i > 0; --i) {
    inv[i] = inv[i + 1] * (i + 1) % mod;
  }
}
long long c(int a, int b) {
  if (a < b) return 0;
  if (a == b) return 1;
  return fac[a] * inv[b] % mod * inv[a - b] % mod;
}
int er[maxn];
int main() {
  init();
  int n, k;
  scanf("%d%d", &n, &k);
  vector<int> v;
  for (int i = 1; i <= n; ++i) {
    er[i] = 0;
    scanf("%d%d", &l[i], &r[i]);
    v.push_back(l[i]);
    v.push_back(r[i]);
    p[i] = make_pair(l[i], r[i]);
  }
  sort(v.begin(), v.end());
  v.erase(unique(v.begin(), v.end()), v.end());
  sort(p + 1, p + 1 + n);
  int pos = 1;
  int num = 0;
  long long ans = 0;
  int maxi = 0;
  for (int i = 1; i <= n; ++i) {
    p[i].first = lower_bound(v.begin(), v.end(), p[i].first) - v.begin() + 1;
    p[i].second = lower_bound(v.begin(), v.end(), p[i].second) - v.begin() + 1;
    maxi = max(p[i].first, maxi);
    maxi = max(maxi, p[i].second);
  }
  for (int i = 1; i <= maxi; ++i) {
    int add = 0;
    while (pos <= n && p[pos].first <= i) {
      add++;
      er[p[pos].second + 1]++;
      pos++;
    }
    num -= er[i];
    ans += c(num + add, k) - c(num, k) + mod;
    num += add;
    ans %= mod;
  }
  cout << ans << endl;
}
