#include <bits/stdc++.h>
using namespace std;
const long double PI = 3.1415926535897932384626433832795;
template <typename S, typename T>
ostream& operator<<(ostream& out, pair<S, T> const& p) {
  out << '(' << p.first << ", " << p.second << ')';
  return out;
}
template <typename T>
ostream& operator<<(ostream& out, vector<T> const& v) {
  int l = v.size();
  for (int i = 0; i < l - 1; i++) out << v[i] << ' ';
  if (l > 0) out << v[l - 1];
  return out;
}
void tr() { cout << endl; }
template <typename S, typename... Strings>
void tr(S x, const Strings&... rest) {
  cout << x << ' ';
  tr(rest...);
}
const int N = 200100;
const long long MOD = 1e9 + 7;
int n, k;
vector<pair<int, int> > v;
set<int> c;
map<int, int> f;
int cnt;
int invf[4 * N];
int r[4 * N];
long long fact[4 * N];
long long fast(long long a, long long b) {
  long long ret = 1;
  while (b) {
    if ((b & 1)) ret = (ret * a) % MOD;
    a = (a * a) % MOD;
    b >>= 1;
  }
  return ret;
}
long long C(int n, int k) {
  return (fact[n] * fast(fact[k], MOD - 2) % MOD) * fast(fact[n - k], MOD - 2) %
         MOD;
}
int main() {
  fact[0] = 1;
  for (int i = 1; i < 4 * N; i++) {
    fact[i] = fact[i - 1] * i % MOD;
  }
  scanf("%d%d", &n, &k);
  for (int i = 0; i < n; i++) {
    int l, r;
    scanf("%d%d", &l, &r);
    v.push_back(make_pair(l, r));
    c.insert(l);
    c.insert(r);
    c.insert(r + 1);
  }
  for (__typeof((c).begin()) it = (c).begin(); it != (c).end(); ++it) {
    f[*it] = ++cnt;
    invf[cnt] = *it;
  }
  for (int i = 0; i < n; i++) {
    v[i].first = f[v[i].first];
    v[i].second = f[v[i].second];
    r[v[i].first]++;
    r[v[i].second + 1]--;
  }
  for (int i = 1; i <= cnt; i++) {
    r[i] += r[i - 1];
  }
  long long ans = 0;
  for (int i = 1; i < cnt; i++) {
    if (r[i] >= k) {
      ans += C(r[i], k) * (invf[i + 1] - invf[i]) % MOD;
      if (ans >= MOD) ans -= MOD;
    }
  }
  cout << ans << endl;
  return 0;
}
