#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1e9 + 7;
long long modpow(long long a, long long n) {
  if (n < 0) {
    a = modpow(a, MOD - 2);
    n = -n;
  }
  long long ret = 1;
  while (n > 0) {
    if (n & 1) ret = (ret * a) % MOD;
    a = (a * a) % MOD;
    n >>= 1;
  }
  return ret;
}
pair<int, int> p[400000];
int dp[200001];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n, k;
  cin >> n >> k;
  for (int i = 0; i < n; i++) {
    int l, r;
    cin >> l >> r;
    p[2 * i] = make_pair(l, 0);
    p[2 * i + 1] = make_pair(r, 1);
  }
  sort(p, p + 2 * n);
  for (int i = 1, c = 1; i < 2 * n; i++) {
    int li = p[i - 1].first, ri = p[i].first;
    if (p[i].second == 0) ri--;
    if (p[i - 1].second == 1) li++;
    dp[c] += max(0, ri - li + 1);
    if (p[i].second == 0)
      c++;
    else
      c--;
  }
  long long ans = 0, tmp, f = 1;
  for (int i = k; i <= n; i++) {
    tmp = (dp[i] * f) % MOD;
    ans = (ans + tmp) % MOD;
    f = (f * (i + 1)) % MOD;
    f = (f * modpow(i + 1 - k, -1)) % MOD;
  }
  cout << ans << '\n';
  return 0;
}
