#include <bits/stdc++.h>
using namespace std;
int64_t modpow(int64_t b, int64_t e, int64_t m) {
  int64_t r = 1;
  while (e > 0) {
    if (e & 1) {
      r = (r * b) % m;
    }
    b = (b * b) % m;
    e >>= 1;
  }
  return r;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  const int64_t MOD = 1e9 + 7;
  int64_t n, k;
  cin >> n >> k;
  vector<int64_t> l(n), r(n);
  vector<int64_t> fact(n + 3);
  fact[0] = 1;
  for (int64_t i = 1; i < n + 3; i++) {
    fact[i] = (fact[i - 1] * i) % MOD;
  }
  map<int64_t, int64_t> points;
  for (int64_t i = 0; i < n; i++) {
    cin >> l[i] >> r[i];
    points[l[i]]++;
    points[r[i] + 1]--;
  }
  int64_t bef = 0;
  for (auto &it : points) {
    it.second += bef;
    bef = it.second;
  }
  auto it = points.begin();
  int64_t ans = 0;
  while (1) {
    int64_t calc = (*it).second;
    int64_t lf = (*it).first;
    it++;
    if (it == points.end()) {
      break;
    }
    if (calc < k) {
      continue;
    }
    int64_t rg = (*it).first;
    int64_t diff = (rg - lf) % MOD;
    int64_t C = ((fact[calc] * modpow(fact[k], MOD - 2, MOD)) % MOD *
                 modpow(fact[calc - k], MOD - 2, MOD)) %
                MOD;
    int64_t temp = (diff * C) % MOD;
    ans = (ans + temp) % MOD;
  }
  cout << ans << '\n';
}
