#include <bits/stdc++.h>
using namespace std;
long long fac[200005], inv[200005];
long long nCr(int n, int r) {
  if (n < r) return 0;
  return fac[n] * inv[r] % 1000000007 * inv[n - r] % 1000000007;
}
long long pow(long long b, int i) {
  long long r = 1;
  for (int j = (29); j >= (0); j--) {
    r = r * r % 1000000007;
    if ((i >> j) & 1) r = r * b % 1000000007;
  }
  return r;
}
pair<int, int> rge[200005];
int tmp[200005 + 200005];
map<int, int> hsh;
int rhsh[200005 + 200005], len[200005 + 200005], dif[200005 + 200005];
int main() {
  int n, k;
  scanf("%d %d", &n, &k);
  fac[0] = inv[0] = 1;
  for (int i = (1); i <= (n); i++) {
    fac[i] = fac[i - 1] * i % 1000000007;
    inv[i] = pow(fac[i], 1000000007 - 2);
  }
  int it = 0;
  for (int i = (1); i <= (n); i++) {
    int l, r;
    scanf("%d %d", &l, &r);
    ++r;
    rge[i] = {l, r};
    tmp[++it] = l;
    tmp[++it] = r;
  }
  sort(tmp + 1, tmp + it + 1);
  tmp[0] = -1000000000 - 1000000000;
  int it2 = 0;
  for (int i = (1); i <= (it); i++) {
    if (tmp[i] != tmp[i - 1]) {
      hsh[tmp[i]] = ++it2;
      rhsh[it2] = tmp[i];
    }
  }
  for (int i = (1); i <= (it2 - 1); i++) len[i] = rhsh[i + 1] - rhsh[i];
  for (int i = (1); i <= (n); i++) {
    int l = rge[i].first, r = rge[i].second;
    l = hsh[l];
    r = hsh[r];
    dif[l]++;
    dif[r]--;
  }
  for (int i = (1); i <= (it2); i++) dif[i] += dif[i - 1];
  long long ans = 0;
  for (int i = (1); i <= (it2 - 1); i++) {
    ans += 1LL * len[i] * nCr(dif[i], k) % 1000000007;
    ans %= 1000000007;
  }
  printf("%lld\n", ans);
  return 0;
}
