#include <bits/stdc++.h>
using namespace std;
const int N = 4e5 + 10;
const long long mod = 1e9 + 7;
long long qpow(long long a, long long b) {
  long long res = 1;
  while (b) {
    if (b & 1) res = res * a % mod;
    a = a * a % mod;
    b >>= 1;
  }
  return res;
}
long long fac[N], ifac[N];
void init(int siz) {
  fac[0] = 1;
  for (int i = 1; i <= siz; i++) fac[i] = i * fac[i - 1] % mod;
  ifac[siz] = qpow(fac[siz], mod - 2);
  for (int i = siz; i >= 1; i--) ifac[i - 1] = ifac[i] * i % mod;
}
long long C(long long n, long long m) {
  if (m == 0 || n == m) return 1;
  if (m > n) return 0;
  if (m == 1) return n;
  return fac[n] * ifac[m] % mod * ifac[n - m] % mod;
}
struct Hash {
  int b[N], tot;
  void init() { tot = 0; }
  void insert(int x) { b[++tot] = x; }
  void build() {
    sort(b + 1, b + 1 + tot);
    tot = unique(b + 1, b + 1 + tot) - (b + 1);
  }
  int pos(int x) { return lower_bound(b + 1, b + 1 + tot, x) - b; }
} ha;
int n, k;
int d[N];
pair<int, int> a[N];
int main() {
  init(4e5);
  scanf("%d%d", &n, &k);
  for (int i = 1; i <= n; i++) {
    int ql, qr;
    scanf("%d%d", &ql, &qr);
    a[i] = {ql, qr + 1};
    ha.insert(ql);
    ha.insert(qr + 1);
  }
  ha.build();
  for (int i = 1; i <= n; i++) {
    int ql = ha.pos(a[i].first), qr = ha.pos(a[i].second);
    d[ql]++, d[qr]--;
  }
  int tot = ha.tot, num = 0;
  long long ans = 0;
  for (int i = 1; i < tot; i++) {
    num += d[i];
    long long sum = ha.b[i + 1] - ha.b[i];
    if (num >= k) ans = (ans + C(num, k) * sum % mod) % mod;
  }
  printf("%lld\n", ans);
  return 0;
}
