#include <bits/stdc++.h>
using namespace std;
const int maxn = 2e5 + 7;
const int mod = 1e9 + 7;
long long fac[maxn];
long long qpow(long long a, long long b) {
  long long ans = 1;
  a %= mod;
  for (long long i = b; i; i >>= 1, a = a * a % mod)
    if (i & 1) ans = ans * a % mod;
  return ans;
}
long long C(long long n, long long m) {
  if (m > n || m < 0) return 0;
  long long s1 = fac[n], s2 = fac[n - m] * fac[m] % mod;
  return s1 * qpow(s2, mod - 2) % mod;
}
int n, k;
int l[maxn], r[maxn];
int main() {
  fac[0] = 1;
  for (int i = 1; i < maxn; i++) fac[i] = fac[i - 1] * i % mod;
  scanf("%d%d", &n, &k);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &l[i]);
    scanf("%d", &r[i]);
  }
  vector<pair<int, int> > op;
  for (int i = 1; i <= n; i++) {
    op.push_back(make_pair(l[i] - 1, 1));
    op.push_back(make_pair(r[i], -1));
  }
  sort(op.begin(), op.end());
  long long ans = 0;
  int cnt = 0;
  int t = 0;
  int la = -2e9;
  for (int i = 0; i < op.size(); i++) {
    ans = (ans + C(cnt, k) * (op[i].first - la)) % mod;
    la = op[i].first;
    cnt += op[i].second;
  }
  cout << ans << endl;
}
