#include <bits/stdc++.h>
using namespace std;
const int mo = 1e9 + 7;
const int N = 2e5 + 10;
int n, k, fac[N] = {1}, fav[N];
int qpow(int a, int b) {
  int ans = 1;
  for (; b >= 1; b >>= 1, a = 1ll * a * a % mo)
    if (b & 1) ans = 1ll * ans * a % mo;
  return ans;
}
int C(int n, int m) { return fac[n] * 1ll * fav[m] % mo * fav[n - m] % mo; }
map<int, int> Map;
int main() {
  scanf("%d%d", &n, &k);
  for (int i = 1; i <= n; i++) fac[i] = 1ll * fac[i - 1] * i % mo;
  fav[n] = qpow(fac[n], mo - 2);
  for (int i = n; i >= 1; i--) fav[i - 1] = 1ll * fav[i] * i % mo;
  for (int i = 1; i <= n; i++) {
    int l, r;
    scanf("%d%d", &l, &r);
    Map[l]++;
    Map[r + 1]--;
  }
  int ans = 0, cnt = 0;
  for (map<int, int>::iterator it = Map.begin(); it != Map.end(); it++) {
    map<int, int>::iterator nxt = it;
    nxt++;
    cnt += it->second;
    if (nxt != Map.end()) {
      if (cnt >= k) {
        ans += 1ll * (nxt->first - it->first) * C(cnt, k) % mo;
        if (ans >= mo) ans -= mo;
      }
    }
  }
  printf("%d\n", ans);
  return 0;
}
