#include <bits/stdc++.h>
using namespace std;
const long long int hell = (long long int)(1e18 + 100LL);
const double pi = acos(-1.0);
vector<long long int> fac(1000005, 0);
long long int me(long long int x, long long int n, long long int md) {
  long long int res = 1LL;
  x = x % md;
  while (n > 0) {
    if (n % 2LL == 1) {
      res = (res * x) % md;
    }
    x = (x * x) % md;
    n /= 2LL;
  }
  return res;
}
long long int ncr(long long int n, long long int r) {
  if (n < r) {
    return 0;
  }
  long long int x, y, z;
  x = fac[n];
  y = fac[r];
  z = fac[n - r];
  y = (y * z) % 998244353;
  y = me(y, 998244353 - 2, 998244353);
  x = (x * y) % 998244353;
  return x;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long int t, i, j, k, m, n, x, y, z;
  t = 1;
  while (t--) {
    long long int flag = 0, K;
    fac[0] = fac[1] = 1;
    for (i = 1; i <= 1000000; i++) {
      fac[i] = (fac[i - 1] * i) % 998244353;
    }
    cin >> m >> K;
    map<long long int, pair<long long int, long long int> > mp;
    for (i = 0; i < m; i++) {
      cin >> x >> y;
      mp[x].first++;
      mp[y + 1].second++;
    }
    vector<pair<long long int, long long int> > V;
    long long int X = 0;
    long long int ans = 0LL;
    for (auto it : mp) {
      x = it.second.first;
      y = it.second.second;
      long long int temp = y;
      while (y--) {
        z = ncr(X - 1, K - 1);
        ans = (ans + z) % 998244353;
        X--;
      }
      X += x;
    }
    cout << ans << "\n";
  }
  return 0;
}
