#include <bits/stdc++.h>
using namespace std;
long long fact[200005];
long long bigmod(long long b, long long p) {
  if (!p) return 1ll;
  long long ret = bigmod(b, p / 2);
  ret = (ret * ret) % 1000000007ll;
  if (p & 1ll) ret = (ret * b) % 1000000007ll;
  return ret;
}
long long ncr(int n, int r) {
  long long nume = fact[n];
  long long deno =
      bigmod((fact[n - r] * fact[r]) % 1000000007ll, 1000000007ll - 2);
  return (nume * deno) % 1000000007ll;
}
map<int, int> mp;
map<int, int>::iterator it;
long long freq[200005];
int main() {
  fact[0] = 1ll;
  for (int i = 1; i <= 200000; i++) fact[i] = (fact[i - 1] * i) % 1000000007ll;
  int n, k, x, y;
  scanf("%d %d", &n, &k);
  for (int i = 0; i < n; i++) scanf("%d %d", &x, &y), mp[x]++, mp[y + 1]--;
  int lst = mp.begin()->first, sum = 0;
  for (it = mp.begin(); it != mp.end(); it++) {
    int x = it->first;
    int y = it->second;
    freq[sum] += (x - lst);
    sum += y;
    lst = x;
  }
  long long res = 0;
  for (int i = k; i <= n; i++)
    res = (res + ncr(i, k) * (freq[i] % 1000000007ll)) % 1000000007ll;
  printf("%lld\n", res);
  return 0;
}
