#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:102400000,102400000")
using namespace std;
const int INF = 0x3f3f3f3f;
const long long INFF = 0x3f3f;
const double pi = acos(-1.0);
const double eps = 1e-8;
const long long mod = 1e9 + 7;
const unsigned long long mx = 133333331;
inline void RI(int &x) {
  char c;
  while ((c = getchar()) < '0' || c > '9')
    ;
  x = c - '0';
  while ((c = getchar()) >= '0' && c <= '9') x = (x << 3) + (x << 1) + c - '0';
}
struct Edge {
  int pos, pre, f;
  bool operator<(const Edge &a) const {
    if (pos == a.pos) return f > a.f;
    return pos < a.pos;
  }
} p[200005 * 2];
multiset<int> s;
long long fact[200005];
long long qpow(long long a, long long n) {
  long long ans = 1;
  while (n) {
    if (n & 1) ans = ans * a % mod;
    a = a * a % mod;
    n >>= 1;
  }
  return ans;
}
long long C(int n, int m) {
  return (fact[n] * qpow(fact[m], mod - 2) % mod) * qpow(fact[n - m], mod - 2) %
         mod;
}
int main() {
  int n, k;
  fact[0] = 1;
  for (int i = 1; i <= 200000; i++) fact[i] = fact[i - 1] * i % mod;
  while (cin >> n >> k) {
    s.clear();
    for (int i = 0; i < n; i++) {
      int l, r;
      scanf("%d%d", &l, &r);
      p[2 * i] = (Edge){l, r, 1};
      p[2 * i + 1] = (Edge){r, l, 0};
    }
    sort(p, p + 2 * n);
    int num = 0;
    int tmp = 0;
    long long ans = 0;
    for (int i = 0; i < 2 * n; i++) {
      if (p[i].f) {
        if (num < k) {
          num++;
          s.insert(p[i].pos);
          tmp = p[i].pos;
        } else {
          s.insert(p[i].pos);
          ans = (ans + (long long)(p[i].pos - tmp) * C(num, k) % mod) % mod;
          tmp = p[i].pos;
          num++;
        }
      } else {
        if (num < k) {
          num--;
          multiset<int>::iterator it = s.find(p[i].pre);
          s.erase(it);
        } else {
          ans = (ans + (long long)(p[i].pos - tmp + 1) * C(num, k) % mod) % mod;
          tmp = p[i].pos + 1;
          multiset<int>::iterator it = s.find(p[i].pre);
          s.erase(it);
          num--;
        }
      }
    }
    cout << ans << endl;
  }
  return 0;
}
