#include <bits/stdc++.h>
using namespace std;
long long ft[200100];
long long ir[200100];
long long fi[200100];
long long md = 1000000000 + 7;
long long c(int n, int k) {
  if (n < k) return 0;
  return ft[n] * fi[n - k] % md * fi[k] % md;
}
long long an = 0;
vector<pair<int, int> > ad;
int main() {
  int n, k;
  ir[1] = 1;
  for (int i = 2; i <= 200000; i++) ir[i] = -md / i * ir[md % i] % md;
  ft[0] = 1, fi[0] = 1;
  for (int i = 1; i <= 200000; i++)
    ft[i] = i * ft[i - 1] % md, fi[i] = ir[i] * fi[i - 1] % md;
  scanf("%d%d", &n, &k);
  for (int i = 1; i <= n; i++) {
    int a, b;
    scanf("%d%d", &a, &b);
    ad.push_back(make_pair(a, 1));
    ad.push_back(make_pair(b + 1, -1));
  }
  int ls = 0;
  int cl = 0;
  sort(ad.begin(), ad.end());
  for (int i = 0; i < ad.size(); i++) {
    int nl = ad[i].first - ls;
    an = (an + nl * c(cl, k)) % md;
    ls = ad[i].first;
    cl += ad[i].second;
  }
  if (an < 0) an += md;
  cout << an;
}
