#include <bits/stdc++.h>
using namespace std;
const int maxn = 500000 + 10;
const int md = 1e9 + 7;
int pos[maxn], c[maxn], hm[maxn], l[maxn], r[maxn], n, k, tot;
long long ans, fac[maxn], p[maxn];
int lowbit(int x) { return x & -x; }
void add(int p, int v) {
  while (p <= tot) {
    c[p] += v;
    p += lowbit(p);
  }
}
int query(int p) {
  int res = 0;
  while (p) {
    res += c[p];
    p -= lowbit(p);
  }
  return res;
}
long long bow(long long x, long long y) {
  long long res = 1;
  while (y) {
    if (y & 1) res = res * x % md;
    y >>= 1;
    x = x * x % md;
  }
  return res;
}
void pre() {
  p[0] = 1;
  for (int i = 1; i <= n; i++) p[i] = p[i - 1] * i % md;
  fac[0] = 1;
  for (int i = 1; i <= n; i++) fac[i] = bow(p[i], md - 2);
}
long long work(long long x) {
  if (x < k) return 0;
  return p[x] * fac[x - k] % md * fac[k] % md;
}
int main() {
  scanf("%d%d", &n, &k);
  pre();
  for (int i = 1; i <= n; i++) {
    scanf("%d%d", &l[i], &r[i]);
    hm[++tot] = l[i];
    hm[++tot] = r[i];
  }
  sort(hm + 1, hm + tot + 1);
  tot = unique(hm + 1, hm + tot + 1) - (hm + 1);
  for (int i = 1; i <= n; i++) {
    l[i] = lower_bound(hm + 1, hm + tot + 1, l[i]) - hm;
    r[i] = lower_bound(hm + 1, hm + tot + 1, r[i]) - hm;
    add(l[i], 1);
    add(r[i], -1);
  }
  for (int i = 1; i < tot; i++) {
    int num = query(i);
    ans += work(num) * (hm[i + 1] - hm[i] - 1) % md;
  }
  memset(c, 0, sizeof(c));
  for (int i = 1; i <= n; i++) {
    add(l[i], 1);
    add(r[i] + 1, -1);
  }
  for (int i = 1; i <= tot; i++) {
    int num = query(i);
    ans = (ans + work(num)) % md;
  }
  printf("%I64d\n", ans);
  return 0;
}
