import sys import numpy as np input = sys.stdin.buffer.readline N, M, K = map(int, input().split()) elv = np.array([tuple(map(int, input().split())) for _ in range(M)]) MOD = 10 ** 9 + 7 dp = np.zeros(N + 2, dtype=np.int64) dp[1] = 1 for _ in range(K): acc = np.cumsum(dp) imos = np.zeros(N + 2, dtype=np.int64) S = acc[elv[:, 1]] - acc[elv[:, 0] - 1] np.add.at(imos, elv[:, 0], S) np.subtract.at(imos, elv[:, 1] + 1, S) dp = np.cumsum(imos) % MOD print(dp[N])