#include <bits/stdc++.h>
using namespace std;
int n, k, x, y, l, r, fact[200001], inv[200001], mod = 1e9 + 7;
map<int, int> m;
int powlog(int a, int b) {
  if (b == 0) return 1;
  int ret = powlog(a, b / 2);
  if (b % 2) return 1LL * ret * ret % mod * a % mod;
  return 1LL * ret * ret % mod;
}
int C(int n, int r) { return 1LL * fact[n] * inv[r] % mod * inv[n - r] % mod; }
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  cout.tie(NULL);
  fact[0] = inv[0] = 1;
  for (int i = 1; i <= 200000; i++) {
    fact[i] = 1LL * i * fact[i - 1] % mod;
    inv[i] = powlog(fact[i], mod - 2);
  }
  cin >> n >> k;
  for (int i = 0; i < n && cin >> x >> y; i++) m[x]++, m[y + 1]--;
  long long ans = 0;
  int prev = 0, lines = 0;
  for (auto &i : m) {
    if (lines >= k)
      ans = (ans + 1LL * (i.first - prev) * C(lines, k) % mod) % mod;
    lines += i.second;
    prev = i.first;
  }
  cout << ans << endl;
  return 0;
}
