#include <bits/stdc++.h>
using namespace std;
inline long long mod(long long n, long long m) {
  long long ret = n % m;
  if (ret < 0) ret += m;
  return ret;
}
long long gcd(long long a, long long b) {
  return (b == 0LL ? a : gcd(b, a % b));
}
long long exp(long long b, long long e, long long m) {
  b %= m;
  long long ans = 1;
  for (; e; b = b * b % m, e /= 2)
    if (e & 1) ans = ans * b % m;
  return ans;
}
const int M = 1e9 + 7;
const int N = 200100;
long long fat[N], inv[N];
void prep() {
  fat[0] = 1;
  for (int i = 1; i < N; i++) {
    fat[i] = fat[i - 1] * (long long)i % M;
  }
  inv[N - 1] = exp(fat[N - 1], M - 2, M);
  for (int i = N - 2; i >= 0; i--) {
    inv[i] = (inv[i + 1] * (long long)(i + 1)) % M;
  }
}
long long C(int n, int k) {
  if (k > n) return 0;
  return 1ll * fat[n] * inv[k] % M * inv[n - k] % M;
}
int32_t main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  int n, k;
  cin >> n >> k;
  vector<pair<int, int> > v;
  for (int i = 0; i < n; i++) {
    int l, r;
    cin >> l >> r;
    v.push_back(pair<int, int>(l, 1));
    v.push_back(pair<int, int>(r + 1, -1));
  }
  prep();
  long long res = 0;
  sort(v.begin(), v.end());
  int a = 0;
  for (int i = 0; i < ((int)v.size());) {
    int cur = v[i].first;
    while (i < ((int)v.size()) and v[i].first == cur) {
      a += v[i++].second;
    }
    if (i == ((int)v.size())) break;
    long long tam = v[i].first - cur;
    res = (res + tam * C(a, k)) % M;
  }
  res = mod(res, M);
  cout << res << "\n";
}
