#include <bits/stdc++.h>
using namespace std;
const double eps = 1e-6;
const double PI = acos(-1.0);
const int INF = 0x3f3f3f3f;
const long long LNF = 0x3f3f3f3f3f3f3f3f;
inline int gcd(int a, int b) { return b ? gcd(b, a % b) : a; }
inline long long gcd(long long a, long long b) { return b ? gcd(b, a % b) : a; }
inline int lcm(int a, int b) { return a * b / gcd(a, b); }
template <class T>
inline void read(T &first) {
  first = 0;
  int f = 1;
  char c = getchar();
  while (c < '0' || c > '9') {
    if (c == '-') f = -1;
    c = getchar();
  }
  while (c >= '0' && c <= '9') {
    first = first * 10 + c - '0';
    c = getchar();
  }
  first = first * f;
}
template <class T>
inline void out(string a, T first) {
  cout << a << " = " << first << endl;
}
const int N = 3e5 + 10, mod = 998244353;
long long f[N];
long long fastPow(long long a, long long b) {
  long long res = 1;
  while (b) {
    if (b & 1) res = res * a % mod;
    b >>= 1;
    a = a * a % mod;
  }
  return res;
}
long long C(int n, int k) {
  return f[n] * fastPow(f[n - k] * f[k] % mod, mod - 2) % mod;
}
bool cmp(pair<int, int> a, pair<int, int> b) {
  return a.first != b.first ? a.first < b.first : a.second > b.second;
}
int main() {
  f[0] = 1;
  for (int i = 1; i < N; i++) f[i] = f[i - 1] * i % mod;
  int n, k;
  cin >> n >> k;
  vector<pair<int, int> > vec(2 * n + 10);
  for (int i = 1; i <= n; i++) {
    int l, r;
    scanf("%d %d", &l, &r);
    vec[i] = {l, 1};
    vec[n + i] = {r, 0};
  }
  sort(vec.begin() + 1, vec.begin() + 2 * n + 1, cmp);
  long long ans = 0;
  int cnt = 0;
  for (int i = 1; i <= 2 * n; i++) {
    if (vec[i].second == 0)
      cnt--;
    else {
      cnt++;
      if (cnt >= k) ans = (ans + C(cnt - 1, k - 1)) % mod;
    }
  }
  cout << ans << endl;
  return 0;
}
