#include <bits/stdc++.h>
using namespace std;
using int64 = long long int;
int64 ReadInt() {
  int64 value;
  cin >> value;
  return value;
}
struct Event {
  int x;
  bool entering;
};
bool EventLess(const Event& left, const Event& right) {
  return left.x < right.x;
}
const int64 kModulo = 1000000007;
int modInverse(const int value) {
  int p1 = 1;
  int p2 = 0;
  int p3 = kModulo;
  int q1 = 0;
  int q2 = 1;
  int q3 = value;
  while (q3 != 0) {
    const int q = p3 / q3;
    const int r1 = p1 - q * q1;
    const int r2 = p2 - q * q2;
    const int r3 = p3 - q * q3;
    p1 = q1;
    p2 = q2;
    p3 = q3;
    q1 = r1;
    q2 = r2;
    q3 = r3;
  }
  if (p2 < 0) {
    p2 += kModulo;
  }
  return p2;
}
int main() {
  const int n = ReadInt();
  const int k = ReadInt();
  std::vector<Event> events;
  for (int i = 0; i < n; ++i) {
    int l = ReadInt();
    int r = ReadInt() + 1;
    events.push_back({l, true});
    events.push_back({r, false});
  }
  std::sort(events.begin(), events.end(), EventLess);
  std::vector<int64> f;
  f.push_back(1);
  for (int i = 1; i <= n; ++i) {
    f.push_back((f.back() * i) % kModulo);
  }
  const int64 fk_inverse = modInverse(f[k]);
  int previous;
  int count = 0;
  int64 answer = 0;
  for (const Event& event : events) {
    const int current = event.x;
    if (count >= k && previous < current) {
      int64 tmp = (f[count] * modInverse(f[count - k])) % kModulo;
      tmp = (tmp * fk_inverse) % kModulo;
      answer = (answer + tmp * (current - previous)) % kModulo;
    }
    previous = current;
    count += (event.entering ? 1 : -1);
  }
  cout << answer << "\n";
  return 0;
}
