#include <bits/stdc++.h>
using namespace std;
struct seg {
  int num;
  int id;
} x[400010];
bool cmp(seg A, seg B) {
  return A.num < B.num || (A.num == B.num && A.id < B.id);
}
long long P = 1e9 + 7, fa[200010], inv[200010], ans = 0;
int tot, n, k, i, now, a, b;
long long c(int m, int n) {
  if (m < n) return 0;
  return fa[m] * inv[n] % P * inv[m - n] % P;
}
long long sqr(long long x) { return x * x % P; }
long long pow(long long a, long long n) {
  if (n == 0) return 1;
  if (n % 2 == 0) return sqr(pow(a, n / 2));
  return sqr(pow(a, n / 2)) * a % P;
}
int main() {
  scanf("%d%d", &n, &k);
  for (i = 1; i <= n; i++) {
    scanf("%d%d", &a, &b);
    x[++tot].num = a;
    x[tot].id = 1;
    x[++tot].num = b + 1;
    x[tot].id = -1;
  }
  fa[0] = inv[0] = 1;
  for (i = 1; i <= n; i++) {
    fa[i] = fa[i - 1] * (long long)i % P;
    inv[i] = inv[i - 1] * pow((long long)i, P - 2) % P;
  }
  sort(x + 1, x + 2 * n + 1, cmp);
  now = 1;
  for (i = 2; i <= 2 * n; i++) {
    if (x[i].num == x[i - 1].num)
      now += x[i].id;
    else {
      ans = (ans + c(now, k) * ((x[i].num - x[i - 1].num) % P) % P) % P;
      now += x[i].id;
    }
  }
  printf("%I64d\n", ans);
  return 0;
}
