#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1e9 + 7, INV = 1e9 + 5, MAX = 2 * 1e5;
vector<pair<long long, long long> > vec;
long long N, K, total = 0, fac[200010], inv_fac[200010];
long long fastPow(long long N, long long X) {
  if (X == 0) return 1;
  if (X == 1) return N;
  long long temp = fastPow(N, X / 2);
  if (X % 2 == 0)
    return temp * temp % MOD;
  else
    return temp * temp % MOD * N % MOD;
}
void factorial() {
  fac[0] = 1;
  for (long long i = 1; i <= MAX; i++) fac[i] = i * fac[i - 1] % MOD;
}
void inverse_fac() {
  for (long long i = 0; i <= MAX; i++) {
    inv_fac[i] = fastPow(fac[i], INV);
  }
}
long long C(long long n, long long k) {
  return fac[n] * inv_fac[k] % MOD * inv_fac[n - k] % MOD;
}
void LineSweep() {
  long long cnt = 0, prev = 0;
  for (pair<long long, long long> &a : vec) {
    if (cnt >= K) total = (total + C(cnt, K) * (a.first - prev) % MOD) % MOD;
    cnt += a.second;
    prev = a.first;
  }
  cout << total << '\n';
}
void Solve() {
  cin >> N >> K;
  for (long long i = 0; i < N; i++) {
    long long st, fin;
    cin >> st >> fin;
    vec.push_back({st, 1});
    vec.push_back({fin + 1, -1});
  }
  sort(vec.begin(), vec.end());
  factorial();
  inverse_fac();
  LineSweep();
}
int main() { Solve(); }
