#include <bits/stdc++.h>
using namespace std;
const int MAX = 200010;
enum EventType { BEG, END };
struct event {
  int pos;
  EventType type;
  int id;
};
vector<event> E;
const long long mod = 1000000007;
long long add(long long a, long long b) { return (a + b) % mod; }
long long mul(long long a, long long b) { return a * b % mod; }
long long powmod(long long a, long long b) {
  if (b == 0) return 1;
  long long h = powmod(a, b / 2);
  return mul(mul(h, h), b % 2 ? a : 1);
}
long long modinv(long long a) { return powmod(a, mod - 2); }
long long f[MAX];
long long invf[MAX];
long long Ck(int n, int k) { return mul(mul(f[n], invf[k]), invf[n - k]); }
int main() {
  int n, k;
  scanf("%d %d", &n, &k);
  f[0] = invf[0] = 1;
  for (int i = (1); i < (n + 1); ++i) {
    f[i] = mul(i, f[i - 1]);
    invf[i] = modinv(f[i]);
  }
  for (int i = (0); i < (n); ++i) {
    int l, r;
    scanf("%d %d", &l, &r);
    E.push_back({l, EventType::BEG, i});
    E.push_back({r, EventType::END, i});
  }
  sort(E.begin(), E.end(), [](const event& e1, const event& e2) {
    if (e1.pos == e2.pos) {
      if (e1.type == e2.type) return e1.id < e2.id;
      return e1.type < e2.type;
    }
    return e1.pos < e2.pos;
  });
  int cnt = 0;
  int i = 0;
  long long ans = 0;
  int cur = 0;
  int lo = E[0].pos;
  while (true) {
    while ((i < (int)((E).size())) and (E[i].type == E[cur].type) &&
           E[i].pos == E[cur].pos) {
      if (E[i].type == EventType::BEG) {
        cnt++;
      } else
        cnt--;
      i++;
    }
    if (i == (int)((E).size())) break;
    int hi = E[i].pos;
    if (E[i].type == EventType::BEG) hi--;
    if (k <= cnt) ans = add(ans, mul(Ck(cnt, k), max(0, (hi - lo + 1))));
    cur = i;
    lo = hi + 1;
  }
  printf("%lld\n", ans);
  return 0;
}
