#include <bits/stdc++.h>
using namespace std;
const int INF = 1e8;
const int MOD = 1e9 + 7;
vector<pair<int, int>> cnt;
int frac[200001];
long long inv(long long x) {
  int n = MOD - 2;
  long long ret = 1;
  while (n) {
    if (n % 2) {
      ret *= x;
      ret %= MOD;
    }
    x *= x;
    x %= MOD;
    n /= 2;
  }
  return ret;
}
int main(void) {
  int i, n, k;
  scanf("%d%d", &n, &k);
  map<int, int> mp;
  for (i = 0; i <= (int)(n)-1; i++) {
    int l, r;
    scanf("%d%d", &l, &r);
    mp[l]++;
    mp[r + 1]--;
  }
  for (auto p : mp) {
    cnt.push_back(p);
  }
  for (i = 0; i <= (int)(cnt.size() - 1) - 1; i++)
    cnt[i + 1].second += cnt[i].second;
  frac[0] = 1;
  for (i = 1; i <= n; i++) frac[i] = (long long)frac[i - 1] * i % MOD;
  long long ans = 0;
  for (i = 0; i <= (int)(cnt.size() - 1) - 1; i++)
    if (cnt[i].second >= k) {
      ans = (ans + frac[cnt[i].second] * inv(frac[k]) % MOD *
                       inv(frac[cnt[i].second - k]) % MOD *
                       (cnt[i + 1].first - cnt[i].first)) %
            MOD;
    }
  printf("%lld\n", ans);
  return 0;
}
