Ori and Sein have overcome many difficult challenges. They finally lit the Shrouded Lantern and found Gumon Seal, the key to the Forlorn Ruins. When they tried to open the door to the ruins... nothing happened.

Ori was very surprised, but Sein gave the explanation quickly: clever Gumon decided to make an additional defence for the door.

There are $n$ lamps with Spirit Tree's light. Sein knows the time of turning on and off for the $i$-th lamp — $l_i$ and $r_i$ respectively. To open the door you have to choose $k$ lamps in such a way that there will be a moment of time when they all will be turned on.

While Sein decides which of the $k$ lamps to pick, Ori is interested: how many ways there are to pick such $k$ lamps that the door will open? It may happen that Sein may be wrong and there are no such $k$ lamps. The answer might be large, so print it modulo $998\,244\,353$.


-----Input-----

First line contains two integers $n$ and $k$ ($1 \le n \le 3 \cdot 10^5$, $1 \le k \le n$) — total number of lamps and the number of lamps that must be turned on simultaneously.

Next $n$ lines contain two integers $l_i$ ans $r_i$ ($1 \le l_i \le r_i \le 10^9$) — period of time when $i$-th lamp is turned on.


-----Output-----

Print one integer — the answer to the task modulo $998\,244\,353$.


-----Examples-----
Input
7 3
1 7
3 8
4 5
6 7
1 3
5 10
8 9

Output
9
Input
3 1
1 1
2 2
3 3

Output
3
Input
3 2
1 1
2 2
3 3

Output
0
Input
3 3
1 3
2 3
3 3

Output
1
Input
5 2
1 3
2 4
3 5
4 6
5 7

Output
7


-----Note-----

In first test case there are nine sets of $k$ lamps: $(1, 2, 3)$, $(1, 2, 4)$, $(1, 2, 5)$, $(1, 2, 6)$, $(1, 3, 6)$, $(1, 4, 6)$, $(2, 3, 6)$, $(2, 4, 6)$, $(2, 6, 7)$.

In second test case $k=1$, so the answer is 3.

In third test case there are no such pairs of lamps.

In forth test case all lamps are turned on in a time $3$, so the answer is 1.

In fifth test case there are seven sets of $k$ lamps: $(1, 2)$, $(1, 3)$, $(2, 3)$, $(2, 4)$, $(3, 4)$, $(3, 5)$, $(4, 5)$.

Difficulty: interview

Starter code:

Solutions:
import sys
input = sys.stdin.readline

MOD = 998244353


MAX = 5 * 10 ** 5 + 5

fact = [1]
for i in range(1, MAX + 1):
    new = fact[-1] * i
    fact.append(new % MOD)

invL = pow(fact[MAX],MOD-2,MOD)
factInv = [invL] * (MAX + 1)
for i in range(MAX - 1, -1, -1):
    old = factInv[i + 1]
    new = old * (i  + 1)
    factInv[i] = new % MOD

def choose(a,b):
    if a < b:
        return 0
    res = fact[a]
    res *= factInv[b]
    res %= MOD
    res *= factInv[a - b]
    res %= MOD
    return res
    

n, k = list(map(int, input().split()))
events = []
for i in range(n):
    s, e = list(map(int, input().split()))
    events.append(2*s+0)
    events.append(2*e+1)
    
events.sort()
count = 0
out = 0
for t in events:
    if t&1== 0:
        out += choose(count, k - 1)
        count += 1
        out %= MOD
    else:
        count -= 1

print(out)


from sys import stdin

def modfac(n, MOD):
 
    f = 1
    factorials = [1]
    for m in range(1, n + 1):
        f *= m
        f %= MOD
        factorials.append(f)
    inv = pow(f, MOD - 2, MOD)
    invs = [1] * (n + 1)
    invs[n] = inv
    for m in range(n, 1, -1):
        inv *= m
        inv %= MOD
        invs[m - 1] = inv
    return factorials, invs

def modnCr(n,r): 
    return fac[n] * inv[n-r] * inv[r] % mod

mod = 998244353
fac,inv = modfac(400000,mod)
n,k = list(map(int,stdin.readline().split()))

l = [float("inf")]
r = [float("inf")]

for i in range(n):

    L,R = list(map(int,stdin.readline().split()))
    l.append(L)
    r.append(R)

l.sort()
l.reverse()
r.sort()
r.reverse()

ans = 0
now = 0

for i in range(2*n):

    if l[-1] <= r[-1]:
        now += 1
        del l[-1]

        if now >= k:
            ans += modnCr(now-1,k-1)
            ans %= mod
    else:
        now -= 1
        del r[-1]

print(ans % mod)


import sys
input = sys.stdin.readline

MOD = 998_244_353
N = 3 * 10 ** 5 + 10

fact = [0 for _ in range(N)]
invfact = [0 for _ in range(N)]
fact[0] = 1
for i in range(1, N):
    fact[i] = fact[i - 1] * i % MOD

invfact[N - 1] = pow(fact[N - 1], MOD - 2, MOD)

for i in range(N - 2, -1, -1):
    invfact[i] = invfact[i + 1] * (i + 1) % MOD
def nCk(n, k):
    if k < 0 or n < k:
        return 0
    else:
        return fact[n] * invfact[k] * invfact[n - k] % MOD

def main():
    n, k = map(int, input().split())
    l_s = []
    r_s = []
    for _ in range(n):
        l, r = map(int, input().split())
        l_s.append(l)
        r_s.append(r)
    l_s.sort()
    r_s.sort()
    l_pos = 0
    r_pos = 0
    total = 0
    ans = 0
    while 1:
        if l_s[l_pos] <= r_s[r_pos]:
            total += 1
            l_pos += 1
            if total >= k:
                ans += nCk(total - 1, k - 1)
                ans %= MOD
            if l_pos == n:
                break
        else:
            total -= 1
            r_pos += 1

    print(ans)
        
    
    
"""
for _ in range(int(input())):
    main()
"""
main()