#include <bits/stdc++.h>
using namespace std;
const int N = 6e5 + 100;
const long long mod = 998244353;
long long fac[N], inv[N];
int l[N], r[N], tot;
pair<int, int> has[N];
long long qpow(long long a, long long b) {
  long long ret = 1;
  while (b) {
    if (b & 1) ret = (ret * a) % mod;
    a = (a * a) % mod;
    b >>= 1;
  }
  return ret;
}
long long C(int n, int m) {
  if (n < m) return 0;
  return ((fac[n] * inv[m]) % mod * inv[n - m]) % mod;
}
int main() {
  fac[0] = inv[0] = 1;
  for (int i = 1; i < N; i++) fac[i] = 1ll * i * fac[i - 1] % mod;
  inv[N - 1] = qpow(fac[N - 1], mod - 2);
  for (int i = N - 2; i >= 1; i--) inv[i] = inv[i + 1] * 1ll * (i + 1) % mod;
  int n, k;
  scanf("%d%d", &n, &k);
  for (int i = 1; i <= n; i++) {
    scanf("%d%d", &l[i], &r[i]);
    has[++tot] = make_pair(l[i], 1);
    has[++tot] = make_pair(r[i] + 1, -1);
  }
  sort(has + 1, has + 1 + tot);
  long long cnt = 0, ans = 0;
  for (int i = 1; i <= tot; i++) {
    if (has[i].second == 1) {
      ans = (ans + C(cnt, k - 1)) % mod;
    }
    cnt += has[i].second;
  }
  printf("%lld\n", ans);
  return 0;
}
