#include <bits/stdc++.h>
using namespace std;
const int N = 300010;
const int P = 998244353;
int n, k;
int fac[N], inv[N], ifac[N];
pair<int, int> a[N];
pair<int, int> b[N << 1];
int c[N << 1];
int num, cnt;
void Init() {
  fac[0] = 1;
  for (int i = 1; i < N; i++) fac[i] = 1ll * fac[i - 1] * i % P;
  inv[0] = inv[1] = 1;
  for (int i = 2; i < N; i++) inv[i] = 1ll * (P - P / i) * inv[P % i] % P;
  ifac[0] = ifac[1] = 1;
  for (int i = 2; i < N; i++) ifac[i] = 1ll * ifac[i - 1] * inv[i] % P;
}
int C(int n, int m) {
  if (n < m) return 0;
  return ((1ll * fac[n] * ifac[m]) % P) * ifac[n - m] % P;
}
bool Cmp(pair<int, int> a, pair<int, int> b) { return a.first < b.first; }
void Update(int x, int y) {
  for (; x <= cnt; x += x & -x) c[x] += y;
}
int Query(int x) {
  int Ans = 0;
  for (; x; x -= x & -x) Ans += c[x];
  return Ans;
}
int main() {
  Init();
  scanf("%d%d", &n, &k);
  for (int i = 1; i <= n; i++) {
    scanf("%d%d", &a[i].first, &a[i].second);
    b[++num] = pair<int, int>(a[i].first, i);
    b[++num] = pair<int, int>(a[i].second, i + n);
  }
  sort(b + 1, b + num + 1);
  for (int i = 1; i <= num; i++) {
    if (b[i].first != b[i - 1].first) cnt++;
    if (b[i].second <= n)
      a[b[i].second].first = cnt;
    else
      a[b[i].second - n].second = cnt;
  }
  int Ans = 0;
  for (int i = 1; i <= n; i++)
    Update(a[i].first, 1), Update(a[i].second + 1, -1);
  for (int i = 1; i <= cnt; i++) Ans = (Ans + C(Query(i), k)) % P;
  sort(a + 1, a + n + 1, Cmp);
  memset(c, 0, sizeof(c));
  int p = 0;
  for (int i = 1; i <= cnt; i++) {
    while (p < n && a[p + 1].first <= i) Update(cnt - a[++p].second + 1, 1);
    Ans = (Ans - C(Query(cnt - i), k)) % P;
  }
  printf("%d\n", (Ans + P) % P);
  return 0;
}
