#include <bits/stdc++.h>
using namespace std;
using P = pair<int, int>;
map<int64_t, int64_t> compression(vector<int64_t> V) {
  map<int64_t, int64_t> ret;
  int64_t cnt = 0;
  sort(V.begin(), V.end());
  for (int i = 0; i < V.size(); i++) {
    if (!ret.count(V[i])) {
      ret[V[i]] = cnt;
      cnt++;
    }
  }
  return ret;
}
const int64_t MAX = 510000;
const int64_t MOD = 998244353;
int64_t fac[MAX], finv[MAX], inv[MAX];
void COMinit() {
  fac[0] = fac[1] = 1;
  finv[0] = finv[1] = 1;
  inv[1] = 1;
  for (int i = 2; i < MAX; i++) {
    fac[i] = fac[i - 1] * i % MOD;
    inv[i] = MOD - inv[MOD % i] * (MOD / i) % MOD;
    finv[i] = finv[i - 1] * inv[i] % MOD;
  }
}
int64_t COM(int64_t n, int64_t k) {
  if (n < k) return 0;
  if (n < 0 || k < 0) return 0;
  return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}
void solve() {
  int N, K;
  cin >> N >> K;
  COMinit();
  vector<int64_t> comp(2 * N);
  vector<P> vec(N);
  for (int i = 0; i < N; i++) {
    int x, y;
    cin >> x >> y;
    comp[i * 2] = x;
    comp[i * 2 + 1] = y;
    vec[i] = P(x, y);
  }
  map<int64_t, int64_t> M = compression(comp);
  for (int i = 0; i < N; i++) {
    vec[i].first = M[vec[i].first];
    vec[i].second = M[vec[i].second];
  }
  vector<int64_t> sum(M.size() + 1);
  vector<int64_t> E(M.size() + 1);
  for (int i = 0; i < N; i++) {
    auto [x, y] = vec[i];
    sum[x]++;
    sum[y + 1]--;
    E[y]++;
  }
  for (int i = 0; i <= M.size(); i++) {
    sum[i + 1] += sum[i];
  }
  int64_t ans = 0;
  for (int i = 0; i < M.size() + 1; i++) {
    for (int j = 1; j <= E[i]; j++) {
      ans += COM(E[i], j) * COM(sum[i] - E[i], K - j);
      ans %= MOD;
    }
  }
  cout << ans << endl;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  int T;
  T = 1;
  for (int i = 0; i < T; i++) {
    solve();
  }
}
