#include <bits/stdc++.h>
const int N = 1e6 + 5;
const int mod = 998244353;
const double PI = acos(-1.0);
const double eps = 1e-8;
using namespace std;
long long qpow(long long a, long long b) {
  long long ans = 1;
  a %= mod;
  for (; b; b >>= 1, a = a * a % mod)
    if (b & 1) ans = (ans * a) % mod;
  return ans;
}
int n, k;
vector<pair<int, int> > vec;
long long pre[N];
long long inline C(int x, int y) {
  if (x < y) return 0;
  return pre[x] * qpow(pre[y] * pre[x - y] % mod, mod - 2) % mod;
}
bool cmp(pair<int, int> a, pair<int, int> b) {
  return a.first == b.first ? a.second > b.second : a.first < b.first;
}
void solve() {
  cin >> n >> k;
  for (int i = 0; i < n; ++i) {
    int temp;
    cin >> temp;
    vec.push_back({temp, 1});
    cin >> temp;
    vec.push_back({temp, -1});
  }
  sort(vec.begin(), vec.end(), cmp);
  long long ans = 0, cnt = 0;
  for (auto p : vec) {
    if (p.second == 1) ans = (ans + C(cnt, k - 1)) % mod;
    cnt += p.second;
  }
  cout << ans;
}
int main() {
  ios::sync_with_stdio(false), cin.tie(0);
  pre[0] = pre[1] = 1;
  for (int i = 2; i < N; ++i) pre[i] = pre[i - 1] * i % mod;
  solve();
  return 0;
}
