#include <bits/stdc++.h>
using namespace std;
const int N = 201000;
const int MOD = 1e9 + 7;
double const pi = acos(-1);
void fre() { freopen("in.txt", "r", stdin); }
long long fac[N];
long long qpow(long long a, long long b) {
  long long ans = 1;
  a %= MOD;
  for (long long i = b; i; i >>= 1, a = a * a % MOD)
    if (i & 1) ans = ans * a % MOD;
  return ans;
}
long long Comb(long long n, long long m) {
  if (m > n || m < 0) return 0;
  long long s1 = fac[n], s2 = fac[n - m] * fac[m] % MOD;
  return s1 * qpow(s2, MOD - 2) % MOD;
}
int main() {
  int k, n;
  fac[0] = 1;
  fac[0] = 1;
  for (int i = 1; i < N; i++) fac[i] = fac[i - 1] * i % MOD;
  scanf("%d%d", &k, &n);
  vector<pair<int, int> > p;
  for (int i = 0; i < k; i++) {
    long long r, l;
    scanf("%I64d %I64d", &l, &r);
    p.push_back(make_pair(l - 1, 1));
    p.push_back(make_pair(r, -1));
  }
  sort(p.begin(), p.end());
  long long ans = 0;
  int nex = 0, last = 0;
  for (int i = 0; i < (int)p.size(); i++) {
    ans = (ans + Comb(nex, n) * (p[i].first - last)) % MOD;
    nex += p[i].second;
    last = p[i].first;
  }
  printf("%I64d\n", ans);
  return 0;
}
