#include <bits/stdc++.h>
using namespace std;
pair<long long, int> p[400007];
long long fac[200007];
long long qp(long long a, long long b) {
  long long ans = 1;
  while (b > 0) {
    if (b & 1) {
      ans = ans * a % 1000000007;
    }
    a = a * a % 1000000007;
    b >>= 1;
  }
  return ans;
}
long long cc(long long n, long long m) {
  if (m < n) {
    return 0;
  }
  return fac[m] * qp(fac[n], 1000000007 - 2) % 1000000007 *
         qp(fac[m - n], 1000000007 - 2) % 1000000007;
}
int main() {
  fac[0] = 1LL;
  for (int i = 1; i <= 200000; i++) {
    fac[i] = fac[i - 1] * i % 1000000007;
  }
  int n, k;
  scanf("%d%d", &n, &k);
  for (int i = 0; i < n; i++) {
    int x, y;
    scanf("%d%d", &x, &y);
    p[i * 2].first = x;
    p[i * 2].second = 1;
    p[i * 2 + 1].first = y + 1;
    p[i * 2 + 1].second = -1;
  }
  sort(p, p + 2 * n);
  p[2 * n].first = -1000000007;
  int t = 0;
  long long ans = 0;
  for (int i = 0; i < 2 * n;) {
    long long tmp = p[i].first;
    while (p[i].first == tmp) t += p[i++].second;
    ans += cc(k, t) * (p[i].first - tmp) % 1000000007;
    ans %= 1000000007;
  }
  printf("%I64d\n", ans);
  return 0;
}
