#include <bits/stdc++.h>
using namespace std;
const int N = 2e+5 + 20;
const int mod = 1e+9 + 7;
vector<pair<int, int>> v;
int fact[N];
int bin_pow(int a, int b) {
  int res = 1;
  while (b) {
    if (b & 1) {
      res = 1ll * res * a % mod;
    }
    b >>= 1;
    a = 1ll * a * a % mod;
  }
  return res;
}
int comb(int n, int k) {
  return n < k ? 0
               : 1ll * fact[n] *
                     bin_pow(1ll * fact[k] * fact[n - k] % mod, mod - 2) % mod;
}
int main() {
  int n, k, i;
  int ans = 0;
  scanf("%d%d", &n, &k);
  fact[0] = 1;
  for (i = 1; i <= n; i++) fact[i] = 1ll * fact[i - 1] * i % mod;
  for (i = 1; i <= n; i++) {
    int l, r;
    scanf("%d%d", &l, &r);
    v.push_back({l, 1});
    v.push_back({r + 1, -1});
  }
  sort(v.begin(), v.end());
  int cur = 0;
  for (size_t i = 0; i + 1 < v.size(); i++) {
    cur += v[i].second;
    ans = (ans + 1ll * (v[i + 1].first - v[i].first) * comb(cur, k)) % mod;
  }
  printf("%d", ans);
  return 0;
}
