#include <bits/stdc++.h>
using namespace std;
const int MAXN = 2e5 + 5;
const long long MOD = 1e9 + 7;
vector<pair<int, int> > segments;
long long dp[MAXN];
long long pot(long long a, long long b) {
  if (b == 0) return 1;
  long long temp = pot(a, b / 2);
  temp = (temp * temp) % MOD;
  if (b % 2) temp = (temp * a) % MOD;
  return temp;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n, k;
  cin >> n >> k;
  for (int i = 0; i < n; i++) {
    int l, r;
    cin >> l >> r;
    segments.push_back(pair<int, int>(l, 1));
    segments.push_back(pair<int, int>(r + 1, -1));
  }
  dp[k] = 1;
  for (int i = k + 1; i <= n; i++) {
    dp[i] = (dp[i - 1] * i) % MOD;
    dp[i] = (dp[i] * pot(i - k, MOD - 2)) % MOD;
  }
  sort(segments.begin(), segments.end());
  long long answer = 0;
  int open = 0;
  int pos = 0;
  int bef = segments[pos].first;
  while (pos < segments.size()) {
    if (open >= k)
      answer = (answer + ((segments[pos].first - bef) * dp[open]) % MOD) % MOD;
    bef = segments[pos].first;
    while (pos < segments.size() - 1 &&
           segments[pos].first == segments[pos + 1].first) {
      open += segments[pos].second;
      ++pos;
    }
    if (pos < segments.size()) {
      open += segments[pos].second;
      ++pos;
    }
  }
  cout << answer;
  return 0;
}
