#include <bits/stdc++.h>
using namespace std;
long long const mod = 998244353;
inline long long add(long long a, long long b) {
  return ((a % mod) + (b % mod) + mod) % mod;
}
inline long long mul(long long a, long long b) {
  return (((a % mod) * (b % mod)) % mod + mod) % mod;
}
inline long long sub(long long a, long long b) {
  return ((a % mod) - (b % mod) + mod) % mod;
}
long long gcd(long long a, long long b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
long long power(long long x, long long y, long long m) {
  if (y == 0) return 1;
  long long p = power(x, y / 2, m) % m;
  p = (p * p) % m;
  return (y % 2 == 0) ? p : (x * p) % m;
}
long long modInv(long long x) { return power(x, mod - 2, mod) % mod; }
long long func(long long a[], long long n, long long i, long long c,
               long long dp[][3]) {
  if (i == n) return 0;
  if (dp[i][c] != -1) return dp[i][c];
  long long ans = func(a, n, i + 1, c, dp);
  if (c == 1) {
    ans = max(ans, a[i] + func(a, n, i + 1, 2, dp));
  } else
    ans = max(ans, func(a, n, i + 1, 1, dp) - a[i]);
  dp[i][c] = ans;
  return ans;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(NULL);
  cout.tie(NULL);
  long long n, k;
  cin >> n >> k;
  vector<pair<long long, long long> > v, v1;
  long long fact[n + 1];
  fact[0] = 1;
  for (long long i = 1; i <= n; i++) fact[i] = mul(fact[i - 1], i);
  for (long long i = 0; i < n; i++) {
    long long l, r;
    cin >> l >> r;
    v.push_back(make_pair(l, r));
    v1.push_back(make_pair(l, 1));
    v1.push_back(make_pair(r, 2));
  }
  sort(v1.begin(), v1.end());
  long long count = 0;
  long long ans = 0;
  for (long long i = 0; i < v1.size(); i++) {
    if (v1[i].second == 2)
      count--;
    else {
      count++;
      if (count >= k) {
        long long num = fact[count - 1];
        long long den = mul(fact[k - 1], fact[count - k]);
        long long z = mul(num, modInv(den));
        ans = add(ans, z);
      }
    }
  }
  cout << ans << endl;
  return 0;
}
