MOD = 10 ** 9 + 7 n, m, k = map(int, input().split()) elevators = [list(map(int, input().split())) for _ in range(m)] dp = [0 for _ in range(n + 2)] dp[1] = 1 for _ in range(k): s = [0 for _ in range(n + 2)] for i in range(1, n + 2): s[i] = (s[i - 1] + dp[i]) % MOD ndp = [0 for _ in range(n + 2)] for l, r in elevators: ndp[l] = (ndp[l] + s[r] - s[l - 1]) % MOD ndp[r + 1] = (ndp[r + 1] - s[r] + s[l - 1]) % MOD for i in range(1, n + 2): ndp[i] = (ndp[i - 1] + ndp[i]) % MOD dp = ndp print(dp[n])