#include <bits/stdc++.h>
using namespace std;
long long int fact[1000005], ifact[1000005], dp[1000005], l[1000005],
    r[1000005], cnt[1000005];
map<long long int, long long int> assign, rev_assign;
vector<long long int> v;
long long int add(long long int x, long long int y) {
  return (x + y) % 1000000007;
}
long long int mul(long long int x, long long int y) {
  return (x * y) % 1000000007;
}
long long int bpow(long long int x, long long int n) {
  long long int ans = 1;
  while (n > 0) {
    if (n & 1) ans *= x;
    x *= x;
    ans %= 1000000007;
    x %= 1000000007;
    n /= 2;
  }
  return ans;
}
void pre_calc(long long int N) {
  fact[0] = ifact[0] = 1;
  for (long long int i = 1; i <= N; ++i) {
    fact[i] = (fact[i - 1] * i) % 1000000007;
    ifact[i] = bpow(fact[i], 1000000007 - 2);
  }
}
long long int ncr(int n, int r) {
  if (r < 0 or n < r) return 0;
  long long int ans = fact[n];
  ans = (ans * ifact[r]) % 1000000007;
  ans = (ans * ifact[n - r]) % 1000000007;
  return ans;
}
int main() {
  ios::sync_with_stdio(false);
  ;
  cin.tie(0);
  ;
  long long int i, j, n, x, y, ans = 0, ctr = 0, balance, k;
  pre_calc(1000000);
  cin >> n >> k;
  for (i = 1; i <= n; i++) {
    cin >> l[i] >> r[i];
    v.push_back(l[i]);
    v.push_back(r[i]);
    v.push_back(r[i] + 1);
  }
  ctr = 0;
  sort(v.begin(), v.end());
  for (i = 0; i < v.size(); i++) {
    if (!assign[v[i]]) {
      ctr++;
      assign[v[i]] = ctr;
      rev_assign[ctr] = v[i];
    }
  }
  for (i = 1; i <= n; i++) {
    cnt[assign[l[i]]]++;
    cnt[assign[r[i] + 1]]--;
  }
  balance = 0;
  for (i = 1; i <= ctr; i++) {
    dp[balance] += rev_assign[i] - rev_assign[i - 1];
    balance += cnt[i];
  }
  for (i = k; i <= n; i++) ans = add(ans, mul(dp[i], ncr(i, k)));
  cout << ans;
  return 0;
}
