#include <bits/stdc++.h>
using namespace std;
map<int, long long> mp;
long long mod = 1e9 + 7, n, i, j, k, l, r, cur, lst, fac[233333], inv[233333],
          first[233333];
long long ans;
long long c(long long x, long long y) {
  return fac[x] * first[y] % mod * first[x - y] % mod;
}
int main() {
  cin >> n >> k;
  fac[0] = fac[1] = inv[0] = inv[1] = first[0] = first[1] = 1;
  for (i = 2; i <= 200000; i++) {
    fac[i] = (fac[i - 1] * i) % mod;
    inv[i] = (mod - mod / i) * inv[mod % i] % mod;
    first[i] = first[i - 1] * inv[i] % mod;
  }
  for (i = 1; i <= n; i++) {
    cin >> l >> r;
    mp[l]++;
    mp[r + 1]--;
  }
  lst = (mp.begin())->first - 1;
  for (map<int, long long>::iterator it = mp.begin(); it != mp.end(); it++) {
    if (cur >= k) {
      ans = (ans + c(cur, k) * (it->first - lst)) % mod;
    }
    cur += it->second;
    lst = it->first;
  }
  cout << ans;
  return 0;
}
