#include <bits/stdc++.h>
using namespace std;
const long long oo = 2e9;
long long M = 1e9 + 7;
multiset<long long> st;
pair<int, int> p[202020];
map<long long, long long> mp;
bool vis[202020];
vector<int> G[202020];
long long q, t, n, m, k, z, x, y, d, sum, mn, mx, ans;
string s;
long long a[2020202], b[2020202];
long long mxl[2020202], mxr[2020202], r[2020202], l[2020202];
const long long N = 300500;
const long long mod = 998244353;
vector<long long> v;
long long fact[N];
long long invFact[N];
long long fast_pow(long long a, long long p) {
  long long res = 1;
  while (p) {
    if (p % 2 == 0) {
      a = (a * a) % mod;
      p /= 2;
    } else {
      res = (res * a) % mod;
      p--;
    }
  }
  return res;
}
long long C(long long n, long long k) {
  if (k > n) {
    return 0;
  }
  return fact[n] * invFact[k] % mod * invFact[n - k] % mod;
}
struct item {
  int val;
  bool end;
};
bool cmp(item a, item b) {
  if (a.val != b.val)
    return a.val < b.val;
  else
    return a.end < b.end;
}
std::vector<item> events;
int main() {
  ios::sync_with_stdio(0), cin.tie(NULL), cout.tie(NULL);
  fact[0] = invFact[0] = 1;
  for (long long i = 1; i < N; i++) {
    fact[i] = (fact[i - 1] * i) % mod;
    invFact[i] = fast_pow(fact[i], mod - 2);
  }
  cin >> n >> k;
  int x, y;
  for (int i = 0; i < n; ++i) {
    cin >> x >> y;
    events.push_back({x, 0});
    events.push_back({y, 1});
  }
  sort(events.begin(), events.end(), cmp);
  int cnt = 0;
  for (int i = 0; i < events.size(); ++i) {
    if (events[i].end) {
      cnt--;
      ans = (ans + C(cnt, k - 1)) % mod;
    } else
      cnt++;
  }
  cout << ans;
}
