#include <bits/stdc++.h>
using namespace std;
long long N, K, MOD = 1e9 + 7, fac[400007], ifac[400007];
pair<long long, long long> A[400007];
long long pow(long long x, long long y) {
  if (!y) return 1;
  long long simp = 1;
  while (y > 1) {
    if (y & 1) simp = simp * x % MOD;
    x = x * x % MOD;
    y /= 2;
  }
  return x * simp % MOD;
}
long long combin(long long x, long long y) {
  return fac[x] * ifac[y] % MOD * ifac[x - y] % MOD;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  fac[0] = ifac[0] = 1;
  for (long long i = 1; i <= 400000; i++) {
    fac[i] = (fac[i - 1] * i) % MOD;
    ifac[i] = pow(fac[i], MOD - 2);
  }
  cin >> N >> K;
  for (int i = 0, j; i < N; i++) {
    cin >> j;
    A[i] = {j, -1};
    cin >> j;
    A[N + i] = {j, 1};
  }
  long long ans = 0;
  sort(A, A + N + N);
  vector<long long> last;
  for (int i = 0, cnt = 0; i < N + N; i++) {
    if (A[i].second == -1) {
      cnt++;
      last.push_back(A[i].first);
    } else if (A[i].second == 1) {
      if (cnt > K) {
        ans += (combin(cnt, K) - combin(cnt - 1, K)) *
               (A[i].first - last.back() + 1) % MOD;
      } else if (cnt == K) {
        ans += combin(cnt, K) * (A[i].first - last.back() + 1) % MOD;
      }
      ans %= MOD;
      last.pop_back();
      cnt--;
    }
  }
  if (ans < 0) ans += MOD;
  cout << ans << '\n';
}
