#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
const long long inf = 1e9;
namespace FastIO {
template <typename tp>
inline void read(tp &x) {
  x = 0;
  char c = getchar();
  bool f = 0;
  for (; c < '0' || c > '9'; f |= (c == '-'), c = getchar())
    ;
  for (; c >= '0' && c <= '9'; x = (x << 3) + (x << 1) + c - '0', c = getchar())
    ;
  if (f) x = -x;
}
template <typename tp>
inline void write(tp x) {
  if (x == 0) return (void)(putchar('0'));
  if (x < 0) putchar('-'), x = -x;
  long long pr[20];
  long long cnt = 0;
  for (; x; x /= 10) pr[++cnt] = x % 10;
  while (cnt) putchar(pr[cnt--] + '0');
}
template <typename tp>
inline void writeln(tp x) {
  write(x);
  putchar('\n');
}
}  // namespace FastIO
using namespace FastIO;
long long n, tot, num, ans;
long long ret, ni, k;
struct Len {
  long long wei, zhen;
} node[400010], new_node[400010];
bool cmp(Len a, Len b) { return a.wei < b.wei; }
long long fact[200010], inv[200010];
void init(int n = 2e5) {
  fact[0] = 1;
  for (int i = 1; i <= n; i++) fact[i] = (long long)i * fact[i - 1] % mod;
  inv[1] = 1;
  for (int i = 2; i <= n; i++)
    inv[i] = mod - (long long)(mod / i) * inv[mod % i] % mod;
  inv[0] = 1;
  for (int i = 1; i <= n; i++) inv[i] = (long long)inv[i - 1] * inv[i] % mod;
}
long long C(long long n, long long m) {
  if (m < 0 || m > n) return 0;
  return (long long)fact[n] * inv[m] % mod * inv[n - m] % mod;
}
int main() {
  read(n), read(k);
  for (int i = 1; i <= n; i++) {
    long long l, r;
    read(l), read(r);
    node[++tot].wei = l;
    node[tot].zhen = 1;
    node[++tot].wei = r + 1;
    node[tot].zhen = -1;
  }
  init();
  sort(node + 1, node + tot + 1, cmp);
  for (int i = 1; i <= tot; i++) {
    if (i == 1 || node[i].wei != node[i - 1].wei)
      new_node[++num].wei = node[i].wei;
    new_node[num].zhen += node[i].zhen;
  }
  long long now = new_node[1].zhen;
  for (int i = 2; i <= num; i++) {
    if (now < k) {
      now += new_node[i].zhen;
      continue;
    }
    long long len = new_node[i].wei - new_node[i - 1].wei;
    ans = (ans + (C(now, k) * len % mod + mod) % mod + mod) % mod;
    now += new_node[i].zhen;
  }
  writeln(ans);
  return 0;
}
