#include <bits/stdc++.h>
using namespace std;
int n, k, p;
int starts[200100];
int enders[200100];
int points[400100];
int ptDensity[400100];
int midDensity[400100];
unsigned long long combin[200100];
unsigned long long inverse[200100];
int t[50];
int r[50];
unsigned long long getInverse(long long a, long long p) {
  if (a == 1) return 1;
  r[0] = p;
  r[1] = a;
  int j = 1;
  while (r[j] > 1) {
    r[j + 1] = r[j - 1] % r[j];
    t[j + 1] = r[j - 1] / r[j];
    j++;
  }
  long long alpha, beta;
  alpha = 1;
  beta = -t[j];
  long long temp;
  for (int k = j - 2; k > 0; k--) {
    temp = alpha;
    alpha = beta;
    beta = temp - beta * t[k + 1];
  }
  beta %= 1000000007;
  if (beta < 0) beta += 1000000007;
  return ((unsigned long long)beta);
}
int main() {
  ios_base::sync_with_stdio(false);
  cin >> n >> k;
  for (int i = 1; i <= n; i++) inverse[i] = getInverse(i, 1000000007);
  for (int i = 0; i < k; i++) combin[i] = 0;
  combin[k] = 1;
  for (int i = k + 1; i <= n; i++) {
    combin[i] = combin[i - 1] * i;
    combin[i] %= 1000000007;
    combin[i] *= inverse[i - k];
    combin[i] %= 1000000007;
  }
  for (int i = 0; i < n; i++) {
    cin >> starts[i] >> enders[i];
  }
  sort(starts, starts + n);
  sort(enders, enders + n);
  starts[n] = 1000000007;
  enders[n] = 1000000007;
  p = 0;
  points[0] = starts[0];
  int a, b;
  a = 1;
  b = 0;
  while (points[p] < 1000000007) {
    while (points[p] == starts[a]) a++;
    while (points[p] == enders[b]) b++;
    if (starts[a] < enders[b])
      points[++p] = starts[a];
    else
      points[++p] = enders[b];
  }
  int h = 0;
  a = 0;
  b = 0;
  for (int i = 0; i < p; i++) {
    while (starts[a] == points[i]) {
      h++;
      a++;
    }
    ptDensity[i] = h;
    while (enders[b] == points[i]) {
      h--;
      b++;
    }
    midDensity[i] = h;
  }
  unsigned long long ans = 0;
  for (int i = 0; i < p; i++) {
    ans += combin[ptDensity[i]];
    ans %= 1000000007;
  }
  for (int i = 0; i < p - 1; i++) {
    ans += combin[midDensity[i]] * (points[i + 1] - points[i] - 1);
    ans %= 1000000007;
  }
  cout << ans << '\n';
  return 0;
}
