#include <bits/stdc++.h>
#pragma GCC optimize(3)
using namespace std;
int qreadInt() {
  int x = 0, op = 1;
  char ch = getchar();
  while (!isdigit(ch)) {
    if (ch == '-') op = -1;
    ch = getchar();
  }
  while (isdigit(ch)) (x *= 10) += (ch - '0'), ch = getchar();
  return x * op;
}
long long qreadLL() {
  long long x = 0, op = 1;
  char ch = getchar();
  while (!isdigit(ch)) {
    if (ch == '-') op = -1;
    ch = getchar();
  }
  while (isdigit(ch)) (x *= 10) += (ch - '0'), ch = getchar();
  return x * op;
}
map<int, int> Map;
const int Mod = 1e9 + 7;
long long Pow(long long a, long long b, long long Mod) {
  long long Ans = 1;
  while (b) {
    if (b & 1) (Ans *= a) %= Mod;
    b >>= 1;
    (a *= a) %= Mod;
  }
  return Ans;
}
long long p[200010], inv[200010], a[200010], b[200010];
long long C(long long a, long long b) {
  if (a < b) return 0;
  return p[a] * inv[b] % Mod * inv[a - b] % Mod;
}
int main() {
  int n = qreadInt(), k = qreadInt();
  inv[0] = p[0] = 1;
  for (int i = (1); i <= (n); ++i) p[i] = p[i - 1] * i % Mod;
  for (int i = (1); i <= (n); ++i) inv[i] = Pow(p[i], Mod - 2, Mod);
  for (int i = (1); i <= (n); ++i) {
    a[i] = qreadInt(), b[i] = qreadInt();
    Map[a[i]]++, Map[b[i] + 1]--;
  }
  long long Ans = 0, sum = 0, bef = Map.begin()->first;
  for (map<int, int>::iterator it = Map.begin(); it != Map.end(); ++it) {
    Ans += 1ll * C(sum, k) * (it->first - bef) % Mod;
    sum += it->second;
    if (Ans >= Mod) Ans -= Mod;
    bef = it->first;
  }
  cout << Ans << endl;
}
