#include <bits/stdc++.h>
using namespace std;
int n, k, cnt = 0, a[300010 * 2], l[300010], r[300010], cl[300010 * 2],
          cr[300010 * 2];
long long f[300010], inv[300010];
int md = 998244353;
long long qpow(long long aa, long long bb) {
  long long ret = 1;
  aa %= md;
  while (bb) {
    if (bb & 1) ret = ret * aa % md;
    aa = aa * aa % md;
    bb /= 2;
  }
  return ret % md;
}
long long C(int x, int y) {
  if (x < y) return 0;
  if (x == y) return 1;
  return f[x] * inv[y] % md * inv[x - y] % md;
}
int main() {
  scanf("%d%d", &n, &k);
  for (int i = 1; i <= n; i++) {
    scanf("%d%d", &l[i], &r[i]);
    a[++cnt] = l[i];
    a[++cnt] = r[i];
  }
  f[0] = 1;
  for (long long i = 1; i <= n; i++) f[i] = f[i - 1] * i % md;
  for (int i = 1; i <= n; i++) inv[i] = qpow(f[i], md - 2 % md);
  sort(a + 1, a + cnt + 1);
  cnt = unique(a + 1, a + cnt + 1) - a - 1;
  for (int i = 1; i <= n; i++) {
    l[i] = lower_bound(a + 1, a + cnt + 1, l[i]) - a;
    r[i] = lower_bound(a + 1, a + cnt + 1, r[i]) - a;
    cl[l[i]]++;
    cr[r[i]]++;
  }
  long long ans = 0;
  int t = 0, nt = 0;
  for (int i = 1; i <= cnt; i++) {
    t -= cr[i - 1];
    nt = cl[i];
    ans = (ans + C(nt + t, k) - C(t, k) + md) % md;
    t += nt;
  }
  printf("%lld", ans % md);
}
