#include <bits/stdc++.h>
using namespace std;
const int nmax = 2e5 + 5;
const int mod = 1e9 + 7;
int pow(int a, int b, int mod) {
  int ans = 1;
  while (b) {
    if (b & 1) ans = (1ll * ans * a) % mod;
    a = (1ll * a * a) % mod;
    b /= 2;
  }
  return ans;
}
int f[nmax], c[nmax];
map<int, int> mp;
int C(int n, int k) {
  int ans = (1ll * f[n] * c[k]) % mod;
  return (1ll * ans * c[n - k]) % mod;
}
int main() {
  int n, k;
  int ans = 0;
  ios_base::sync_with_stdio(0);
  cin >> n >> k;
  f[0] = c[0] = 1;
  for (int i = 1; i <= n; i++)
    f[i] = (1ll * f[i - 1] * i) % mod, c[i] = pow(f[i], mod - 2, mod);
  for (int i = 1; i <= n; i++) {
    int a, b;
    cin >> a >> b;
    ++mp[a];
    --mp[b + 1];
  }
  int l = mp.begin()->first;
  int sum = 0;
  for (auto it : mp) {
    int dist = it.first - l;
    if (sum >= k) ans += (1ll * C(sum, k) * dist) % mod;
    ans %= mod;
    sum += it.second;
    l = it.first;
  }
  cout << ans << endl;
  return 0;
}
