#include <bits/stdc++.h>
using namespace std;
const int N = 411111;
const int M = 1e9 + 7;
int k, n;
long long lsh[N + N], g[N], f[N], h[N];
struct Node {
  int l, r;
} a[N];
long long RP(long long a) {
  long long Ans = 1, b = M - 2;
  for (; b; b >>= 1) {
    if (b & 1) Ans = Ans * a % M;
    a = a * a % M;
  }
  return Ans;
}
long long C(long long n, long long m) {
  return f[n] * RP(f[m]) % M * RP(f[n - m]) % M;
}
int main() {
  f[0] = 1;
  for (int i = 1; i <= 400000; i++) f[i] = f[i - 1] * i % M;
  scanf("%d%d", &n, &k);
  int m = 0;
  for (int i = 1; i <= n; i++) {
    int l, r;
    scanf("%d%d", &l, &r);
    lsh[++m] = l;
    lsh[++m] = r;
    a[i].l = l;
    a[i].r = r;
  }
  sort(lsh + 1, lsh + m + 1);
  m = unique(lsh + 1, lsh + m + 1) - (lsh + 1);
  for (int i = 1; i <= n; i++) {
    int t = lower_bound(lsh + 1, lsh + m + 1, a[i].l) - lsh;
    h[t]++;
    g[t]++;
    t = lower_bound(lsh + 1, lsh + m + 1, a[i].r) - lsh;
    h[t + 1]--;
    g[t]--;
  }
  long long Ans = 0;
  for (int i = 1; i <= 400000; i++)
    h[i] = h[i] + h[i - 1], g[i] = g[i] + g[i - 1];
  for (int i = 1; i <= 400000; i++) {
    if (k <= h[i]) Ans = (Ans + C(h[i], k) % M) % M;
    if (k <= g[i] && i < 400000)
      Ans = (Ans + (lsh[i + 1] - lsh[i] - 1) * C(g[i], k) % M) % M;
  }
  cout << (Ans % M + M) % M << endl;
  return 0;
}
