#include <bits/stdc++.h>
using namespace std;
const int mod = (int)1e9 + 7;
const int N = (int)2e5 + 5;
int n, k, x[N + N], xn, s[N + N], s1[N + N];
pair<int, int> a[N];
long long fact[N], revf[N], rev[N];
long long C(int n, int k) {
  if (n < 0 || k < 0 || n < k) return 0ll;
  long long ans = fact[n] * revf[k] % mod * revf[n - k] % mod;
  return ans;
}
int main() {
  fact[0] = revf[0] = 1;
  for (int i = 1; i < N; i++) {
    if (i == 1)
      rev[1] = 1;
    else
      rev[i] = (mod - mod / i) * rev[mod % i] % mod;
    fact[i] = fact[i - 1] * i % mod;
    revf[i] = revf[i - 1] * rev[i] % mod;
  }
  scanf("%d %d", &n, &k);
  for (int i = 1; i <= n; i++) {
    scanf("%d %d", &a[i].first, &a[i].second);
    x[xn++] = a[i].first;
    x[xn++] = a[i].second;
  }
  sort(x, x + xn);
  xn = unique(x, x + xn) - x;
  for (int i = 1; i <= n; i++) {
    a[i].first = lower_bound(x, x + xn, a[i].first) - x;
    a[i].second = lower_bound(x, x + xn, a[i].second) - x;
    s[a[i].first]++;
    s[a[i].second]--;
    s1[a[i].first]++;
    s1[a[i].second + 1]--;
  }
  int m = 0;
  long long ans = 0;
  for (int i = 0; i < xn - 1; i++) {
    m += s[i];
    ans += C(m, k) * (x[i + 1] - x[i] - 1) % mod;
    if (ans >= mod) ans -= mod;
  }
  m = 0;
  for (int i = 0; i < xn; i++) {
    m += s1[i];
    ans += C(m, k);
    if (ans >= mod) ans -= mod;
  }
  cout << ans << "\n";
  return 0;
}
