#include <bits/stdc++.h>
using namespace std;
const int N = 200123;
const long long MOD = 1e9 + 7;
long long f[N];
long long binPow(long long a, long long p) {
  if (p == 0LL) return 1LL;
  long long x = binPow(a, p / 2LL);
  x = (x * x) % MOD;
  x *= (p % 2LL ? a : 1LL);
  return x % MOD;
}
long long getCnk(int k, int n) {
  if (k > n) return 0LL;
  return (f[n] * binPow((f[k] * f[n - k]) % MOD, MOD - 2LL)) % MOD;
}
int main() {
  map<int, int> cnt;
  int n, k;
  scanf("%d%d", &n, &k);
  for (int i = 0; i < n; ++i) {
    int l, r;
    scanf("%d%d", &l, &r);
    ++cnt[l], --cnt[r + 1];
  }
  f[0] = 1LL;
  for (int i = 1; i <= n; ++i) f[i] = (f[i - 1] * (long long)i) % MOD;
  int cur = 0;
  long long ans = 0;
  for (auto it = cnt.begin(); it != cnt.end(); ++it) {
    auto it2 = it;
    ++it2;
    if (it2 == cnt.end()) break;
    cur += it->second;
    ans += getCnk(k, cur) * (long long)(it2->first - it->first);
    ans %= MOD;
  }
  cout << ans;
  return 0;
}
