#include <bits/stdc++.h>
using namespace std;
const int INF = 1e9 + 250;
long long mod = 1e9 + 7;
const int N = 200005;
long long fac[N];
long long quick_pow(long long x, long long p, long long mod) {
  long long ret = 1;
  while (p) {
    if (p & 1) ret = ret * x % mod;
    p >>= 1;
    x = x * x % mod;
  }
  return ret;
}
void com_init(int n) {
  fac[0] = 1;
  for (int i = 1; i <= n; i++) {
    fac[i] = fac[i - 1] * i % mod;
  }
}
long long com(int n, int m) {
  return n < m ? 0
               : fac[n] * quick_pow(fac[n - m], mod - 2, mod) % mod *
                     quick_pow(fac[m], mod - 2, mod) % mod;
}
int l[N], r[N];
int a[N * 4];
int b[N * 4];
map<int, int> mp;
int main() {
  com_init(200000);
  int n, m;
  long long ans = 0;
  scanf("%d%d", &n, &m);
  int ct = 0;
  for (int i = 0; i < n; i++) {
    scanf("%d%d", &l[i], &r[i]);
    a[ct++] = l[i];
    a[ct++] = r[i];
    a[ct++] = r[i] + 1;
  }
  sort(a, a + ct);
  ct = unique(a, a + ct) - a;
  for (int i = 0; i < ct; i++) {
    mp[a[i]] = i;
  }
  for (int i = 0; i < n; i++) {
    b[mp[l[i]]]++;
    b[mp[r[i]] + 1]--;
  }
  int t = 0;
  a[ct] = a[ct - 1] + 1;
  for (int i = 0; i < ct; i++) {
    t += b[i];
    ans = (ans + (a[i + 1] - a[i]) * com(t, m)) % mod;
  }
  cout << ans << endl;
  return 0;
}
