#include <bits/stdc++.h>
const long long N = 1000010;
const long long MOD = 1000000007;
using namespace std;
struct nn {
  long long l, r;
} a[N];
long long n, k, x[N], m, ans, c[N], jie[N], las, num = 0;
long long ksm(long long x, long long y) {
  long long res = 1;
  while (y) {
    if (y % 2 == 1) res = (res * x) % MOD;
    x = (x * x) % MOD;
    y /= 2;
  }
  return res;
}
long long C(long long x, long long y) {
  if (x <= y) return 1;
  return (jie[x] * ksm(jie[y] * jie[x - y] % MOD, MOD - 2) % MOD);
}
void Init() {
  jie[1] = 1;
  for (long long i = 2; i <= n; i++) jie[i] = jie[i - 1] * i % MOD;
}
int main() {
  scanf("%lld%lld", &n, &k);
  Init();
  for (long long i = 1; i <= n; i++) {
    scanf("%lld%lld", &a[i].l, &a[i].r);
    a[i].r++;
    x[i] = a[i].l;
    x[i + n] = a[i].r;
  }
  sort(x + 1, x + n * 2 + 1);
  long long m = unique(x + 1, x + n * 2 + 1) - x - 1;
  for (long long i = 1; i <= n; i++) {
    a[i].l = lower_bound(x + 1, x + m + 1, a[i].l) - x;
    a[i].r = lower_bound(x + 1, x + m + 1, a[i].r) - x;
    c[a[i].l]++;
    c[a[i].r]--;
  }
  for (long long i = 1; i <= m; i++) {
    c[i] += c[i - 1];
    if (num >= k) {
      ans += C(num, k) * (x[i] - x[i - 1]) % MOD;
      ans %= MOD;
    }
    num = c[i];
  }
  printf("%lld\n", ans);
  return 0;
}
