from itertools import accumulate N, M, K = map(int, input().split()) mod = 10**9 + 7 LR = [tuple(map(int, input().split())) for _ in range(M)] dp = [0] * (N + 2) dp[1] = 1 for _ in range(K): dp1 = [0] * (N + 2) dpac = list(accumulate(dp)) for l, r in LR: dp1[l] += dpac[r] - dpac[l - 1] dp1[r + 1] -= dpac[r] - dpac[l - 1] dp = list(map(lambda x: x % mod, accumulate(dp1))) print(dp[-2])