#include <bits/stdc++.h>
using namespace std;
const long long N = 2e5 + 5, mod = 1e9 + 7;
long long n, k;
long long Pow[N], ans[N];
vector<pair<long long, long long> > v;
long long cal(long long a, long long b) {
  if (b == 0) return 1;
  long long res = cal(a, b / 2);
  res = (res * res) % mod;
  if (b % 2) res = (res * a) % mod;
  return res;
}
long long Ckn(long long k, long long n) {
  long long res = Pow[n];
  res = (res * cal((Pow[n - k] * Pow[k]) % mod, mod - 2)) % mod;
  return res;
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cin >> n >> k;
  Pow[0] = 1;
  for (long long i = 1; i <= n; ++i) Pow[i] = Pow[i - 1] * i % mod;
  for (long long i = 1; i <= n; ++i) {
    long long l, r;
    cin >> l >> r;
    l += mod - 7;
    r += mod - 7;
    v.push_back(pair<long long, long long>(l, 0));
    v.push_back(pair<long long, long long>(r, 1));
  }
  sort(v.begin(), v.end());
  long long res = 0;
  for (long long i = 0; i < v.size(); ++i) {
    if (v[i].second == 0) {
      if (i > 0) ans[res] += v[i].first - v[i - 1].first - 1;
      ans[++res]++;
    } else {
      ans[res] += v[i].first - v[i - 1].first;
      res--;
    }
  }
  long long x = 0;
  for (long long i = k; i <= n; ++i) x = (x + ans[i] * Ckn(k, i)) % mod;
  cout << x;
}
