#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 5;
const long long mod = 1e9 + 7;
struct point {
  long long x, id;
} p[2 * N];
long long inv[N], fact[N];
int n, k;
long long qpow(long long a, long long b) {
  long long ans = 1;
  while (b) {
    if (b & 1) ans = ans * a % mod;
    b >>= 1;
    a = a * a % mod;
  }
  return ans;
}
long long C(long long a, long long b) {
  if (a < b) return 0;
  if (a == b) return 1;
  return fact[a] * inv[b] % mod * inv[a - b] % mod;
}
bool cmp(const point &a, const point &b) { return a.x < b.x; }
int main() {
  fact[0] = 1;
  for (int i = 1; i <= 200000; i++) fact[i] = fact[i - 1] * i % mod;
  for (int i = 1; i <= 200000; i++) inv[i] = qpow(fact[i], mod - 2);
  scanf("%d%d", &n, &k);
  for (int i = 1; i <= n; i++) {
    scanf("%lld%lld", &p[2 * i - 1].x, &p[2 * i].x);
    p[2 * i - 1].id = 1, p[2 * i].id = -1;
    p[2 * i].x++;
  }
  sort(p + 1, p + 2 * n + 1, cmp);
  long long cnt = 0, ans = 0, pre = 0;
  for (int i = 1; i <= 2 * n; i++) {
    if (i > 1) ans = (ans + (p[i].x - pre) * C(cnt, k) % mod) % mod;
    pre = p[i].x;
    cnt += p[i].id;
  }
  printf("%lld\n", ans);
  return 0;
}
