N, M, K = map(int, input().split()) elv = [tuple(map(int, input().split())) for _ in range(M)] MOD = 10 ** 9 + 7 dp = [0] * (N + 2) dp[1] = 1 def accumulate_mod(X): res = [0] * len(X) res[0] = X[0] for i in range(1, len(X)): res[i] = (res[i - 1] + X[i]) % MOD return res for _ in range(K): acc = accumulate_mod(dp) imos = [0] * (N + 2) for l, r in elv: s = acc[r] - acc[l - 1] imos[l] += s imos[r + 1] -= s dp = accumulate_mod(imos) print(dp[N])