#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1000000007;
long long POW(long long a, long long b, long long MMM = MOD) {
  long long ret = 1;
  for (; b; b >>= 1, a = (a * a) % MMM)
    if (b & 1) ret = (ret * a) % MMM;
  return ret;
}
long long gcd(long long a, long long b) { return b ? gcd(b, a % b) : a; }
long long lcm(long long a, long long b) {
  if (a == 0 || b == 0) return a + b;
  return a * (b / gcd(a, b));
}
int dx[] = {0, 1, 0, -1, 1, 1, -1, -1}, dy[] = {1, 0, -1, 0, 1, -1, 1, -1};
long long fac[200001];
long long inv[200001];
long long nCr(int n, int r) {
  if (r > n) return 0;
  long long c = fac[n];
  c = (c * inv[r]) % MOD;
  c = (c * inv[n - r]) % MOD;
  return c;
}
pair<long long, long long> p[200000];
vector<long long> vv;
long long tree[600005], sz[600005];
int N;
void upd(int i, int k) {
  while (i <= N) {
    tree[i] += k;
    i += (i & -i);
  }
}
long long sum(int i) {
  int c = 0;
  while (i > 0) {
    c += tree[i];
    i -= (i & -i);
  }
  return c;
}
int main() {
  fac[0] = inv[0] = 1;
  for (int(i) = (1); (i) <= (200000); (i) += (1))
    fac[i] = (fac[i - 1] * i) % MOD;
  inv[200000] = POW(fac[200000], MOD - 2);
  for (int(i) = (199999); (i) >= (1); (i) -= (1))
    inv[i] = (inv[i + 1] * (i + 1)) % MOD;
  int n, k;
  scanf("%d%d", &n, &k);
  for (int(i) = (0); (i) <= (n - 1); (i) += (1)) {
    scanf("%lld%lld", &p[i].first, &p[i].second);
    vv.push_back(p[i].first);
    vv.push_back(p[i].second);
    vv.push_back(p[i].second + 1);
  }
  sort(vv.begin(), vv.end());
  vv.resize(unique(vv.begin(), vv.end()) - vv.begin());
  N = vv.size();
  for (int(i) = (0); (i) <= (n - 1); (i) += (1)) {
    p[i].first = lower_bound(vv.begin(), vv.end(), p[i].first) - vv.begin() + 1;
    p[i].second =
        lower_bound(vv.begin(), vv.end(), p[i].second) - vv.begin() + 1;
    upd(p[i].first, 1);
    upd(p[i].second + 1, -1);
  }
  for (int(i) = (1); (i) <= (N - 1); (i) += (1)) sz[i] = vv[i] - vv[i - 1];
  long long ans = 0;
  for (int(i) = (1); (i) <= (N - 1); (i) += (1))
    ans = (ans + sz[i] * nCr(sum(i), k)) % MOD;
  printf("%lld", ans);
}
