#include <bits/stdc++.h>
using namespace std;
void _read(int &x) {
  x = 0;
  char ch = getchar();
  bool flag = false;
  while (ch < '0' || ch > '9') {
    if (ch == '-') flag = true;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    x = x * 10 + ch - '0';
    ch = getchar();
  }
  if (flag) x = -x;
  return;
}
int N, K, B[400005 * 2], cnt, L[400005], R[400005];
int sum[400005], ans = 0;
long long C[400005], inv[400005];
char s[25];
int ct;
void Out(long long x) {
  ct = 0;
  if (x < 0) {
    putchar('-');
    x = -x;
  }
  if (!x) {
    putchar('0');
  }
  while (x) s[++ct] = x % 10 + '0', x = x / 10;
  while (ct) putchar(s[ct]), ct--;
  putchar('\n');
  return;
}
int main() {
  _read(N);
  _read(K);
  cnt = 0;
  for (int i = 1; i <= N; i++) {
    _read(L[i]);
    _read(R[i]);
    B[++cnt] = L[i] - 1;
    B[++cnt] = R[i];
  }
  sort(B + 1, B + 1 + cnt);
  cnt = unique(B + 1, B + 1 + cnt) - B - 1;
  for (int i = 1; i <= N; i++) {
    L[i] = lower_bound(B + 1, B + 1 + cnt, L[i] - 1) - B;
    R[i] = lower_bound(B + 1, B + 1 + cnt, R[i]) - B;
    sum[L[i]]++;
    sum[R[i]]--;
  }
  C[K] = 1;
  inv[0] = inv[1] = 1;
  for (int i = 2; i <= 400000; i++)
    inv[i] = (1000000007 - (1000000007 / i)) * inv[1000000007 % i] % 1000000007;
  for (int i = K + 1; i <= N; i++)
    C[i] = C[i - 1] * i % 1000000007 * inv[i - K] % 1000000007;
  int now = 0;
  for (int i = 1; i <= cnt; i++) {
    if (now >= K) {
      ans = (ans + C[now] * (B[i] - B[i - 1]) % 1000000007) % 1000000007;
    }
    now += sum[i];
  }
  Out(ans);
  return 0;
}
