#include <bits/stdc++.h>
using namespace std;
template <class T>
inline void rread(T& num) {
  num = 0;
  T f = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') num = num * 10 + ch - '0', ch = getchar();
  num *= f;
}
inline int getgcd(int x, int y) {
  if (!x) return y;
  return getgcd(y % x, x);
}
inline long long getlcm(int x, int y) {
  return (long long)x / getgcd(x, y) * y;
}
inline long long getgcd(long long x, long long y) {
  if (!x) return y;
  return getgcd(y % x, x);
}
inline long long getlcm(long long x, long long y) {
  return x / getgcd(x, y) * y;
}
inline int power(int x, int k, int p) {
  int res = 1;
  for (; k; k >>= 1, x = (long long)x * x % p)
    if (k & 1) res = (long long)res * x % p;
  return res;
}
inline long long power(long long x, long long k, long long p) {
  long long res = 1;
  for (; k; k >>= 1, x = x * x % p)
    if (k & 1) res = res * x % p;
  return res;
}
const double pi = acos(-1);
inline void judge() { freopen("input.txt", "r", stdin); }
const int maxn = 200000, mod = 1e9 + 7;
int fac[maxn + 5], ifac[maxn + 5];
int n, k, ans;
vector<pair<int, int> > q;
inline int C(int n, int m) {
  if (n < m) return 0;
  return 1ll * fac[n] * ifac[m] % mod * ifac[n - m] % mod;
}
int main() {
  fac[0] = 1;
  for (int(i) = (1); (i) <= (maxn); (i)++) fac[i] = 1ll * fac[i - 1] * i % mod;
  ifac[maxn] = power(fac[maxn], mod - 2, mod);
  for (int(i) = (maxn - 1); (i) >= (0); (i)--)
    ifac[i] = 1ll * ifac[i + 1] * (i + 1) % mod;
  rread(n);
  rread(k);
  for (int(i) = (1); (i) <= (n); (i)++) {
    int l, r;
    rread(l);
    rread(r);
    q.push_back(make_pair(l, 1));
    q.push_back(make_pair(r + 1, -1));
  }
  sort(q.begin(), q.end());
  int cnt = 1, last = q[0].first;
  for (int(i) = (1); (i) < ((int((q).size()))); (i)++) {
    ans = (ans + 1ll * C(cnt, k) * ((q[i].first - last) % mod) % mod) % mod;
    last = q[i].first;
    cnt += q[i].second;
  }
  printf("%d\n", ans);
  return 0;
}
