#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1e9 + 7;
vector<pair<int, int> > v;
long long c[200005];
long long inv[200005];
int main() {
  int k, n;
  while (cin >> n >> k) {
    inv[1] = 1;
    for (int i = 2; i <= n; i++) inv[i] = inv[MOD % i] * (MOD - MOD / i) % MOD;
    c[k] = 1;
    for (int i = k + 1; i <= n; i++) {
      c[i] = c[i - 1] * (long long)i % MOD * inv[i - k] % MOD;
    }
    int x, y;
    for (int i = 1; i <= n; i++) {
      scanf("%d%d", &x, &y);
      v.push_back(make_pair(x, -1));
      v.push_back(make_pair(y, 1));
    }
    sort(v.begin(), v.end());
    v.push_back(make_pair(v[v.size() - 1].first, -1));
    int num = 0;
    long long ans = 0;
    for (int i = 0; i < v.size() - 1;) {
      x = v[i].first;
      long long tmp = 0;
      while (v[i].first == x && i < v.size() - 1) {
        if (v[i].second == -1)
          num++;
        else
          tmp++;
        i++;
      }
      if (num >= k) {
        ans = (ans + c[num]) % MOD;
      }
      num -= tmp;
      if (num >= k && i != v.size() - 1) {
        int nxt = v[i].first;
        ans = (ans + c[num] * (nxt - x - 1) % MOD) % MOD;
      }
    }
    cout << ans << endl;
  }
  return 0;
}
