#include <bits/stdc++.h>
using namespace std;
const int N = 1e6 + 10;
const int MOD = 1e9 + 7;
int n, k, f[N], rev[N], l[N], r[N], ps[N];
vector<int> v;
void dfs(int);
int _mul(int, int);
int _pow(int, int);
int choose(int, int);
void _push(int &, int);
int main() {
  cin >> n >> k;
  for (int i = 0; i < n; i++) {
    cin >> l[i] >> r[i];
    v.push_back(l[i]);
    v.push_back(++r[i]);
  }
  sort(v.begin(), v.end());
  v.resize(unique(v.begin(), v.end()) - v.begin());
  for (int i = 0; i < n; i++) {
    l[i] = lower_bound(v.begin(), v.end(), l[i]) - v.begin();
    r[i] = lower_bound(v.begin(), v.end(), r[i]) - v.begin();
  }
  for (int i = 0; i < n; i++) {
    ps[l[i]]++;
    ps[r[i]]--;
  }
  for (int i = 1; i < v.size(); i++) ps[i] += ps[i - 1];
  for (int i = 0; i <= n; i++) {
    f[i] = i ? _mul(f[i - 1], i) : 1;
    rev[i] = _pow(f[i], MOD - 2);
  }
  int ans = 0;
  for (int i = 0; i < v.size() - 1; i++)
    _push(ans, _mul(v[i + 1] - v[i], choose(k, ps[i])));
  cout << ans << endl;
}
int _mul(int a, int b) { return 1LL * a * b % MOD; }
int _pow(int a, int b) {
  if (!b) return 1;
  int res = _pow(a, b >> 1);
  res = _mul(res, res);
  if (b & 1) res = _mul(res, a);
  return res;
}
int choose(int k, int n) {
  if (k > n) return 0;
  return _mul(f[n], _mul(rev[k], rev[n - k]));
}
void _push(int &b, int a) {
  b += a;
  if (b >= MOD) b -= MOD;
}
