#include <bits/stdc++.h>
long long int const MOD = 1000000007;
long long int const N = 1000005;
long long int const LN = 20;
long long int const inf = 8e18;
using namespace std;
long long int fact[N];
long long int ifact[N];
long long int bexpo(long long int x, long long int n, long long int m) {
  long long int r = 1;
  x = x % m;
  while (n > 0) {
    if (n % 2) r = (r * x) % m;
    x = (x * x) % m;
    n = n / 2;
  }
  return r;
}
long long int ncr(long long int n, long long int r) {
  if (r > n) return 0;
  long long int ans = fact[n];
  ans = (ans * ifact[r]) % MOD;
  ans = (ans * ifact[n - r]) % MOD;
  return ans;
}
void pre() {
  fact[0] = 1;
  ifact[0] = 1;
  for (long long int i = 1; i < N; i++) fact[i] = (fact[i - 1] * i) % MOD;
  ifact[N - 1] = bexpo(fact[N - 1], MOD - 2, MOD);
  for (long long int i = N - 2; i > 0; i--)
    ifact[i] = (ifact[i + 1] * (i + 1)) % MOD;
}
long long int n, m, a[N];
map<long long int, long long int> mp;
pair<long long int, long long int> e[N];
long long int cnt[N];
vector<long long int> v;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  pre();
  long long int n, k;
  cin >> n >> k;
  for (long long int i = 1; i <= n; i++) {
    long long int l, r;
    cin >> l >> r;
    r++;
    e[i] = {l, r};
    mp[l] = 1;
    mp[r] = 1;
  }
  long long int kk = 0;
  for (auto &w : mp) w.second = ++kk;
  for (long long int i = 1; i <= n; i++) {
    cnt[mp[e[i].first]]++;
    cnt[mp[e[i].second]]--;
  }
  long long int ans = 0;
  for (auto w : mp) v.push_back(w.first);
  long long int sz = v.size();
  long long int tot = cnt[1];
  for (long long int i = 1; i < sz; i++) {
    long long int temp = (v[i] - v[i - 1]) * ncr(tot, k) % MOD;
    ans += temp;
    ans %= MOD;
    tot += cnt[i + 1];
  }
  cout << ans;
  return 0;
}
