#include <bits/stdc++.h>
#pragma GCC optimize(3)
using namespace std;
const int N = 6e5 + 10, mod = 998244353;
int n, t, m;
long long fact[N];
struct node {
  int p, id;
  bool operator<(const node &a) const { return p == a.p ? id < a.id : p < a.p; }
};
vector<node> v;
void init() {
  fact[0] = 1;
  for (int i = 1; i < N; i++) {
    fact[i] = (fact[i - 1] * i) % mod;
  }
}
long long ksm(long long a, long long b) {
  long long res = 1 % mod;
  while (b) {
    if (b & 1) res = (res * a) % mod;
    b >>= 1;
    a = (a * a) % mod;
  }
  return res % mod;
}
long long cc(long long n, long long m) {
  if (m > n)
    return 0;
  else if (m == 0 || m == n)
    return 1;
  else {
    return fact[n] * ksm(fact[m], mod - 2) % mod * ksm(fact[n - m], mod - 2) %
           mod;
  }
}
void solve() {
  scanf("%d%d", &n, &m);
  v.clear();
  for (int i = 1, x, y; i <= n; i++) {
    scanf("%d%d", &x, &y);
    v.push_back({x, 1});
    v.push_back({y + 1, -1});
  }
  sort(v.begin(), v.end());
  long long ans = 0, cnt = 0;
  for (auto i : v) {
    if (i.id == 1) {
      ans = (ans + cc(cnt, m - 1) % mod) % mod;
    }
    cnt += i.id;
  }
  printf("%lld\n", ans);
}
int main() {
  init();
  solve();
  return 0;
}
