#include <bits/stdc++.h>
using namespace std;
int n, k, m, cnt;
long long fac[200005];
struct Node {
  int x, v;
  bool operator<(const Node& a) const {
    if (x == a.x) return v > a.v;
    return x < a.x;
  }
} node[200005 << 1];
int a[200005 << 1], sum[200005 << 1];
int has[200005 << 1];
long long ksm(long long a, long long b) {
  long long res = 1;
  while (b) {
    if (b & 1) res = res * a % 1000000007;
    b >>= 1;
    a = a * a % 1000000007;
  }
  return res;
}
long long C(long long n, long long m) {
  if (n < m || m < 0) return 0;
  long long s1 = fac[n], s2 = fac[n - m] * fac[m] % 1000000007;
  return s1 * ksm(s2, 1000000007 - 2) % 1000000007;
}
int main() {
  int i, j, group, x, y, v;
  fac[0] = 1;
  cnt = 0;
  for (i = 1; i < 200005; ++i) fac[i] = fac[i - 1] * i % 1000000007;
  scanf("%d%d", &n, &k);
  for (i = 1; i <= n; ++i) {
    scanf("%d%d", &x, &y);
    node[cnt].x = x;
    node[cnt++].v = 1;
    node[cnt].x = y + 1;
    node[cnt++].v = -1;
  }
  sort(node, node + cnt);
  long long ans = 0, la, num = 0;
  for (i = 0; i < cnt; ++i) {
    if (num >= k) ans = (ans + (node[i].x - la * 1ll) * C(num, k)) % 1000000007;
    la = node[i].x;
    num += node[i].v;
  }
  printf("%I64d\n", ans);
  return 0;
}
