//1<=b<=a<=1e5 ,Cab mod (1e9+7)
#include <iostream>
#include <algorithm>
#define ll long long
using namespace std;
const int N=300010,mod=998244353;
ll fact[N],infact[N];
struct P{
int num,v;
}a[N];
ll ans=0;
vector<P> v;
bool cmp(P x,P y){
if(x.num==y.num)
return x.v>y.v;
else
return x.num<y.num;
}
ll qmi(ll a,ll b,ll m)
{
int ans=1;
while(b)
{
if(b&1) ans=(ll)ans*a%m;
a=(ll)a*a%m;
b>>=1;
}
return ans;
}
ll cc(ll a,ll b){
if(b>a) return 0;
return fact[a]*infact[b]%mod*infact[a-b]%mod;
}
int main()
{
fact[0]=infact[0]=1;
for(int i=1;i<N;i++)
{
fact[i]=(ll)fact[i-1]*i%mod;//求阶乘
infact[i]=(ll)infact[i-1]*qmi(i,mod-2,mod)%mod;//求i阶乘逆元
}
int n,k;
scanf("%d%d",&n,&k);
while(n--)
{
int x,y;
scanf("%d%d",&x,&y);
P t={x,1};
v.push_back(t);
t={y,-1};
v.push_back(t);
}
sort(v.begin(),v.end(),cmp);
int cnt=0;
for(auto i:v){
if(i.v==1) ans=(ans+cc(cnt,k-1))%mod;
cnt+=i.v;
}
printf("%lld\n",ans);
return 0;
}