#include <bits/stdc++.h>
using namespace std;
pair<int, int> lines[200000];
int seg[1650000] = {0};
map<int, int> x;
long long fact[200010];
inline long long mult(long long a, long long b) {
  return (a * b) % 1000000007LL;
}
long long pow_mod(long long b, long long e) {
  if (e == 0) return 1;
  long long x = pow_mod(b, e / 2);
  x = mult(x, x);
  if (e & 1) x = mult(x, b);
  return x;
}
void insert_seg(int i, int lpost, int rpost, int l, int r) {
  if (rpost - lpost == 1)
    seg[i]++;
  else if (rpost == r && lpost == l)
    seg[i]++;
  else {
    int mid = (rpost + lpost) / 2;
    if (mid <= l) {
      insert_seg(2 * i + 1, mid, rpost, l, r);
    } else if (r <= mid) {
      insert_seg(2 * i, lpost, mid, l, r);
    } else {
      insert_seg(2 * i, lpost, mid, l, mid);
      insert_seg(2 * i + 1, mid, rpost, mid, r);
    }
  }
}
int find_seg(int i, int lpost, int rpost, int val) {
  if (rpost - lpost == 1) return seg[i];
  int mid = (lpost + rpost) / 2;
  if (mid <= val)
    return find_seg(2 * i + 1, mid, rpost, val) + seg[i];
  else
    return find_seg(2 * i, lpost, mid, val) + seg[i];
}
int main() {
  int n, k;
  scanf("%d %d", &n, &k);
  fact[0] = 1;
  for (int i = 1; i <= 200000; i++) {
    fact[i] = mult(fact[i - 1], i);
  }
  for (int i = 0; i < n; i++) {
    int a, b;
    scanf("%d %d", &a, &b);
    lines[i] = {a, b + 1};
    x.insert({a, 0});
    x.insert({b + 1, 0});
  }
  int count = 0;
  for (auto a = x.begin(); a != x.end(); a++) {
    a->second = count;
    count++;
  }
  for (int i = 0; i < n; i++) {
    int i1 = x.find(lines[i].first)->second;
    int i2 = x.find(lines[i].second)->second;
    insert_seg(1, 0, x.size(), i1, i2);
  }
  long long ans = 0;
  auto next = x.begin();
  for (int i = 0; i < x.size() - 1; i++) {
    auto b = next;
    next++;
    int appear = find_seg(1, 0, x.size(), i);
    if (appear >= k) {
      long long ncr = fact[appear];
      long long denom = mult(pow_mod(fact[k], 1000000007LL - 2),
                             pow_mod(fact[appear - k], 1000000007LL - 2));
      ncr = mult(ncr, denom);
      ans += mult(next->first - b->first, ncr);
      if (ans >= 1000000007LL) ans -= 1000000007LL;
    }
  }
  cout << ans << '\n';
}
