#include <bits/stdc++.h>
using namespace std;
inline int ckmax(int &a, int b) { return a < b ? a = b, 1 : 0; }
inline int ckmin(int &a, int b) { return a > b ? a = b, 1 : 0; }
const int maxn = 200100;
int n, k, l[maxn], r[maxn], d[3 * maxn], fac[maxn], inv[maxn];
int pow(int a, int b) {
  int ans = 1;
  for (; b; b >>= 1, a = (long long)a * a % 1000000007)
    if (b & 1) ans = (long long)ans * a % 1000000007;
  return ans;
}
int C(int n, int m) {
  return (long long)fac[n] * inv[m] % 1000000007 * inv[n - m] % 1000000007;
}
int main() {
  scanf("%d%d", &n, &k);
  fac[0] = 1;
  for (int i = 1; i <= n; ++i) fac[i] = (long long)fac[i - 1] * i % 1000000007;
  inv[n] = pow(fac[n], 1000000007 - 2);
  for (int i = n - 1; i >= 0; --i)
    inv[i] = (long long)inv[i + 1] * (i + 1) % 1000000007;
  vector<int> q;
  for (int i = 1; i <= n; ++i) {
    scanf("%d%d", l + i, r + i);
    q.push_back(l[i]);
    q.push_back(r[i]);
    q.push_back(r[i] + 1);
  }
  sort(q.begin(), q.end());
  q.erase(unique(q.begin(), q.end()), q.end());
  for (int i = 1; i <= n; ++i) {
    l[i] = lower_bound(q.begin(), q.end(), l[i]) - q.begin();
    r[i] = lower_bound(q.begin(), q.end(), r[i]) - q.begin();
    d[l[i]]++;
    d[r[i] + 1]--;
  }
  int now = 0, ans = 0;
  for (int i = 0; i <= q.size(); ++i) {
    if (now >= k) {
      (ans += (long long)C(now, k) * (q[i] - q[i - 1]) % 1000000007) %=
          1000000007;
    }
    now += d[i];
  }
  printf("%d\n", ans);
  return 0;
}
