#include <bits/stdc++.h>
using namespace std;
int read() {
  int a = 0;
  char c = getchar();
  bool f = 0;
  while (!isdigit(c)) {
    f = c == '-';
    c = getchar();
  }
  while (isdigit(c)) {
    a = a * 10 + c - 48;
    c = getchar();
  }
  return f ? -a : a;
}
const long long _ = 2e5 + 3, MOD = 1e9 + 7;
vector<pair<long long, long long> > seg;
vector<long long> p;
long long N, K, jc[_], inv[_];
long long poww(long long a, long long b) {
  long long times = 1;
  while (b) {
    if (b & 1) times = times * a % MOD;
    a = a * a % MOD;
    b >>= 1;
  }
  return times;
}
long long binom(long long a, long long b) {
  return a < b ? 0 : jc[a] * inv[b] % MOD * inv[a - b] % MOD;
}
signed main() {
  N = read();
  K = read();
  jc[0] = 1;
  for (long long i = 1; i <= N; ++i) jc[i] = jc[i - 1] * i % MOD;
  inv[N] = poww(jc[N], MOD - 2) % MOD;
  for (long long i = N - 1; i >= 0; --i) inv[i] = inv[i + 1] * (i + 1) % MOD;
  for (long long i = 1; i <= N; ++i) {
    long long l = read(), r = read() + 1;
    seg.push_back(pair<long long, long long>(l, r));
    p.push_back(l);
    p.push_back(r);
  }
  sort(seg.begin(), seg.end());
  sort(p.begin(), p.end());
  p.resize(unique(p.begin(), p.end()) - p.begin());
  long long ans = 0, pos = 0;
  priority_queue<long long, vector<long long>, greater<long long> > q;
  for (long long i = 0; i + 1 < p.size(); ++i) {
    while (pos < seg.size() && seg[pos].first == p[i])
      q.push(seg[pos++].second);
    while (!q.empty() && q.top() == p[i]) q.pop();
    ans = (ans + binom(q.size(), K) * (p[i + 1] - p[i])) % MOD;
  }
  cout << ans;
  return 0;
}
