#include <bits/stdc++.h>
using namespace std;
const long long N = 2e5 + 5;
const long long mod = 1e9 + 7;
long long power(long long a, long long p, long long mod) {
  long long res = 1;
  while (p) {
    if (p & 1) res = (res * a) % mod;
    a = (1ll * a * a) % mod;
    p /= 2;
  }
  return res;
}
long long fact[N];
long long ins[N];
map<long long, long long> s;
long long C(long long n, long long k) {
  return (((fact[n] * ins[n - k]) % mod) * ins[k]) % mod;
}
int main() {
  long long n, k;
  long long ans = 0;
  cin >> n >> k;
  fact[0] = ins[0] = 1;
  for (long long i = 1, _b = (n); i <= _b; i++)
    fact[i] = (1ll * fact[i - 1] * i) % mod,
    ins[i] = power(fact[i], mod - 2, mod);
  for (long long i = 1, _b = (n); i <= _b; i++) {
    long long a, b;
    cin >> a >> b;
    ++s[a];
    --s[b + 1];
  }
  long long last = s.begin()->first;
  long long curr_cover = 0;
  for (typeof((s).begin()) i = (s).begin(); i != (s).end(); i++) {
    pair<long long, long long> it = *i;
    long long dist = it.first - last;
    if (curr_cover >= k) ans += (1ll * C(curr_cover, k) * dist) % mod;
    while (ans >= mod) ans -= mod;
    curr_cover += it.second;
    last = it.first;
  }
  return cout << ans << '\n', 0;
}
