#include <bits/stdc++.h>
using namespace std;
constexpr int N = 200007;
long long f[N], fr[N];
long long mod = 1000 * 1000 * 1000 + 7;
long long bin_pow(long long n, long long e) {
  long long r = 1;
  while (e > 0) {
    if (e & 1) {
      r = (r * n) % mod;
    }
    n = (n * n) % mod;
    e /= 2;
  }
  return r;
}
void precalc() {
  f[0] = 1;
  for (int i = 1; i < N; ++i) {
    f[i] = (f[i - 1] * i) % mod;
  }
  fr[0] = 1;
  for (int i = 1; i < N; ++i) {
    fr[i] = bin_pow(f[i], mod - 2);
  }
}
long long cnk(int n, int k) {
  if (n < k) {
    return 0;
  }
  return (((f[n] * fr[k]) % mod) * fr[n - k]) % mod;
}
struct Event {
  int cor, type;
  Event() {}
  Event(int cor, int type) : cor(cor), type(type) {}
  bool operator<(const Event& e) const {
    return (cor != e.cor) ? cor < e.cor : type < e.type;
  }
};
void solve() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  precalc();
  int n, k;
  cin >> n >> k;
  int a, b;
  vector<Event> ev;
  for (int i = 0; i < n; ++i) {
    cin >> a >> b;
    ev.push_back(Event(a, -1));
    ev.push_back(Event(b + 1, 1));
  }
  sort(ev.begin(), ev.end());
  long long res = 0, cnt = 0, last = ev[0].cor;
  for (int i = 0; i < ev.size();) {
    Event e = ev[i];
    res = (res + 1LL * (e.cor - last) * cnk(cnt, k)) % mod;
    while (i < ev.size() && ev[i].cor == e.cor) {
      cnt -= ev[i].type;
      ++i;
    }
    last = e.cor;
  }
  cout << res << endl;
}
int main() {
  solve();
  return 0;
}
