#include <bits/stdc++.h>
using namespace std;
const long long int mod = 1e9 + 7;
const int N = 3e5 + 1;
long long int f[N], invf[N];
long long int mpow(long long int x, long long int y) {
  long long int res = 1;
  x = x % mod;
  while (y > 0) {
    if (y & 1) res = (res * x) % mod;
    y = y >> 1;
    x = (x * x) % mod;
  }
  return res;
}
long long int modInv(long long int n) { return mpow(n, mod - 2); }
long long int C(long long int n, long long int r) {
  if (r == 0) return 1;
  if (n < r) return 0;
  assert(n >= r);
  return (f[n] * invf[r] % mod * invf[n - r] % mod) % mod;
}
void fact() {
  f[0] = 1;
  invf[0] = 1;
  for (int i = 1; i < N; i++) {
    f[i] = (f[i - 1] * i) % mod;
    invf[i] = modInv(f[i]);
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long int T = clock();
  fact();
  long long int n, k;
  cin >> n >> k;
  map<long long int, long long int> mpp;
  for (long long int i = 0; i < n; i++) {
    long long int l, r;
    cin >> l >> r;
    mpp[l - 1]++;
    mpp[r]--;
  }
  long long int ans = 0;
  vector<pair<long long int, long long int>> a;
  for (auto p : mpp) a.push_back({p.first, p.second});
  long long int cur = a[0].second;
  for (long long int i = 1; i < a.size(); i++) {
    long long int prv = a[i - 1].first;
    ans = (ans + (a[i].first - prv) * C(cur, k) % mod) % mod;
    cur += a[i].second;
  }
  cout << ans;
  cerr << "\n\nTIME: " << (double)(clock() - T) / CLOCKS_PER_SEC << " sec\n";
  T = clock();
  return 0;
}
