#include <bits/stdc++.h>
using namespace std;
const int P = 998244353;
const int INF = 0x3f3f3f3f;
const long long LL_INF = 0x3f3f3f3f3f3f3f3f;
long long fac[300003]{1};
long long f(long long n, int k) {
  long long ret = 1;
  while (k) {
    if (k & 1) ret = ret * n % P;
    n = n * n % P;
    k >>= 1;
  }
  return ret;
}
long long C(long long n, long long r) {
  if (n < r) return 0;
  return fac[n] * f(fac[r] * fac[n - r] % P, P - 2) % P;
}
int main() {
  int n, m, i, j, k, mx = 0;
  pair<int, int> a[600003];
  scanf("%d%d", &n, &k);
  for (i = 0; i < n; ++i) {
    int l, r;
    scanf("%d%d", &l, &r);
    a[i * 2] = {l, 1};
    a[i * 2 + 1] = {r + 1, -1};
    mx = max(mx, l);
  }
  for (i = 1; i <= n; ++i) fac[i] = fac[i - 1] * i % P;
  sort(a, a + 2 * n);
  int cnt = 0, tmp1 = 1, tmp2 = 0;
  long long ans = 0;
  for (i = 1; i < 2 * n; ++i) {
    while (i < 2 * n && a[i].first == a[i - 1].first) {
      if (a[i].second > 0)
        tmp1++;
      else
        tmp2--;
      i++;
    }
    if (tmp1 > 0)
      ans = (ans + C(cnt + tmp1 + tmp2, k) - C(cnt + tmp2, k) + P) % P;
    cnt += tmp1 + tmp2;
    if (a[i].second > 0)
      tmp1 = 1, tmp2 = 0;
    else
      tmp1 = 0, tmp2 = -1;
  }
  printf("%d", ans);
  return 0;
}
