#include <bits/stdc++.h>
using namespace std;
struct event {
  int type;
  int where;
  bool operator<(const event that) const { return where < that.where; }
};
int n, k;
vector<event> lis;
long long F[200001];
long long invF[200001];
long long mod = 1000000007LL;
long long power(long long a, long long b) {
  long long ret = 1;
  while (b) {
    if (b & 1) ret = (ret * a) % mod;
    a = (a * a) % mod;
    b /= 2;
  }
  return ret;
}
long long inv(long long x) { return power(x, mod - 2); }
long long C(int n, int m) {
  if (m < 0 || m > n) return 0;
  long long ret = F[n];
  ret *= invF[m];
  ret %= mod;
  ret *= invF[n - m];
  ret %= mod;
  return ret;
}
int MAIN() {
  F[0] = invF[0] = 1;
  for (int i = 1; i <= 200000; i++) {
    F[i] = (F[i - 1] * i) % mod;
    invF[i] = inv(F[i]);
  }
  cin >> n >> k;
  for (int i = 1; i <= n; i++) {
    int L, R;
    cin >> L >> R;
    event t;
    t.type = 1;
    t.where = L;
    lis.push_back(t);
    t.type = -1;
    t.where = R + 1;
    lis.push_back(t);
  }
  int lastPos = -1000000001;
  int current = 0;
  long long ans = 0;
  sort(lis.begin(), lis.end());
  for (int i = 0; i < lis.size(); i++) {
    long long amount = lis[i].where - lastPos;
    ans += amount * C(current, k);
    ans %= mod;
    lastPos = lis[i].where;
    current += lis[i].type;
  }
  cout << ans << endl;
  return 0;
}
int main() {
  int start = clock();
  ios ::sync_with_stdio(false);
  cout << fixed << setprecision(16);
  int ret = MAIN();
  return ret;
}
