#include <bits/stdc++.h>
using namespace std;
map<long long int, int> mp;
long long int fact[200003];
void pre() {
  long long int i;
  fact[0] = 1;
  for (i = 1; i < 200003; i++) fact[i] = (fact[i - 1] * i) % 1000000007;
}
long long int po(long long int a, long long int b) {
  long long int ans = 1;
  while (b) {
    if (b & 1) ans = (ans * a) % 1000000007;
    a = (a * a) % 1000000007;
    b = b / 2;
  }
  return ans;
}
int main() {
  int i, n, k;
  pre();
  scanf("%d%d", &n, &k);
  for (i = 0; i < n; i++) {
    long long int a, b;
    scanf("%lld%lld", &a, &b);
    mp[a]++;
    mp[b + 1]--;
  }
  map<long long int, int>::iterator it = mp.begin();
  long long int ans = 0, tot = (*it).second, st = (*it).first;
  it++;
  for (; it != mp.end(); it++) {
    long long int ele = (*it).first;
    if (tot >= k) {
      long long int temp = fact[tot];
      temp = (temp * po(fact[k], 1000000007 - 2)) % 1000000007;
      temp = (temp * po(fact[tot - k], 1000000007 - 2)) % 1000000007;
      ans = (ans + ((ele - st) * temp) % 1000000007) % 1000000007;
    }
    tot += mp[ele];
    st = ele;
  }
  printf("%lld", ans);
  return 0;
}
