#include <bits/stdc++.h>
using namespace std;
const int maxn = 300000;
const long long oo = 998244353;
int n, k;
long long frac[maxn + 1];
int l[maxn], r[maxn];
vector<int> v;
set<int> cur;
vector<int> cur_ad[maxn * 2], cur_rm[maxn * 2];
set<int> both;
vector<int> both_ad[maxn * 2], both_rm[maxn * 2];
long long Ck[maxn + 1];
int index(int x) {
  return distance(v.begin(), lower_bound(begin(v), end(v), x));
}
void init() {
  frac[0] = 1;
  for (int i = 1; i < (maxn + 1); ++i) frac[i] = (frac[i - 1] * i) % oo;
}
long long pow(long long x, long long y) {
  if (y == 0) return 1;
  long long p = pow(x, y / 2);
  p = p * p % oo;
  if (y % 2 == 1) p = p * x % oo;
  return p;
}
long long C(long long n, long long k) {
  if (n < k) return 0;
  if (k == 0 or k == n) return 1;
  long long tuso = frac[n];
  long long mauso = frac[k] * frac[n - k] % oo;
  return tuso * pow(mauso, oo - 2) % oo;
}
int main() {
  cin.tie(0)->sync_with_stdio(0);
  cin.exceptions(cin.failbit);
  init();
  cin >> n >> k;
  for (int i = 0; i < (n); ++i) {
    cin >> l[i] >> r[i];
    v.push_back(l[i]), v.push_back(r[i]);
  }
  for (int i = 0; i < (maxn + 1); ++i) Ck[i] = C(i, k);
  sort(begin(v), end(v));
  v.erase(unique(begin(v), end(v)), v.end());
  for (int i = 0; i < (n); ++i) {
    l[i] = index(l[i]);
    r[i] = index(r[i]);
    cur_ad[l[i]].push_back(i);
    cur_rm[r[i]].push_back(i);
    if (l[i] != r[i]) {
      both_ad[l[i] + 1].push_back(i);
      both_rm[r[i]].push_back(i);
    }
  }
  cur.clear();
  both.clear();
  long long res = 0;
  for (int i = 0; i < ((int)(v).size()); ++i) {
    for (int v : cur_ad[i]) cur.insert(v);
    for (int v : both_ad[i]) both.insert(v);
    res = (res + (long long)Ck[(int)(cur).size()] -
           (long long)Ck[(int)(both).size()] + oo * oo) %
          oo;
    for (int v : cur_rm[i]) cur.erase(v);
    for (int v : both_rm[i]) both.erase(v);
  }
  cout << res;
}
