#include <bits/stdc++.h>
using namespace std;
long long nCk[200001];
long long ModExp(int a, int n, int m) {
  long long x = a, y = 1;
  while (n > 0) {
    if (n % 2) y = (y * x) % 1000000007;
    x = (x * x) % 1000000007;
    n /= 2;
  }
  return y;
}
long long ModInverse(int a, int p) { return ModExp(a, p - 2, p); }
void PreComputeNcK(int n, int k) {
  nCk[k] = 1;
  for (int i = k + 1; i <= n; i++)
    nCk[i] = (((i * ModInverse(i - k, 1000000007)) % 1000000007) * nCk[i - 1]) %
             1000000007;
}
int main() {
  int n, i, j, k, cnt, prevX, currX;
  long long ans = 0;
  map<int, int> m;
  map<int, int>::iterator it;
  scanf("%d%d", &n, &k);
  PreComputeNcK(n, k);
  while (n--) {
    scanf("%d%d", &i, &j);
    j++;
    it = m.find(i);
    if (it != m.end())
      it->second++;
    else
      m.insert(make_pair(i, 1));
    it = m.find(j);
    if (it != m.end())
      it->second--;
    else
      m.insert(make_pair(j, -1));
  }
  for (it = m.begin(), cnt = 0; it != m.end(); it++) {
    currX = it->first;
    ans = (ans + (currX - prevX) * nCk[cnt]) % 1000000007;
    prevX = currX;
    cnt += it->second;
  }
  cout << ans << '\n';
  return 0;
}
