#include <bits/stdc++.h>
using namespace std;
const int md = 1e9 + 7;
const int N = 2e5 + 10;
inline void add(int &a, int b) {
  a += b;
  if (a >= md) {
    a -= md;
  }
}
inline void sub(int &a, int b) {
  a -= b;
  if (a < 0) {
    a += md;
  }
}
inline int mul(int a, int b) { return (long long)a * b % md; }
inline int power(int a, int b) {
  int res = 1;
  while (b > 0) {
    if (b & 1) {
      res = mul(res, a);
    }
    b >>= 1;
    a = mul(a, a);
  }
  return res;
}
inline int inv(int x) { return power(x, md - 2); }
pair<int, int> event[2 * N];
int fac[N], invFac[N];
void preprocess() {
  fac[0] = 1;
  for (int i = 1; i < N; i++) fac[i] = mul(fac[i - 1], i);
  invFac[N - 1] = inv(fac[N - 1]);
  for (int i = N - 2; i >= 0; i--) invFac[i] = mul(invFac[i + 1], i + 1);
}
int nCr(int n, int r) {
  int num = fac[n];
  int den = mul(invFac[r], invFac[n - r]);
  return mul(num, den);
}
int main() {
  preprocess();
  int n, k;
  scanf("%d %d", &n, &k);
  for (int i = 0; i < n; i++) {
    int a, b;
    scanf("%d %d", &a, &b);
    event[2 * i] = make_pair(a, 1);
    event[2 * i + 1] = make_pair(b + 1, -1);
  }
  sort(event, event + 2 * n);
  int ans = 0, cnt = 0;
  for (int i = 0; i < 2 * n; i++) {
    if (cnt >= k) {
      add(ans, mul(nCr(cnt, k), event[i].first - event[i - 1].first));
    }
    cnt += event[i].second;
  }
  printf("%d\n", ans);
}
