import numpy as np import sys input = sys.stdin.buffer.readline sys.setrecursionlimit(10 ** 7) mod = 10**9+7 n, m, k = map(int, input().split()) L, R = np.array([input().split() for _ in range(m)], dtype=np.int64).T dp = np.ones(n+2, dtype=np.int64) dp[0] = 0 for _ in range(k): newDP = np.zeros_like(dp) cnt = dp[R] - dp[L - 1] np.add.at(newDP, L, cnt) np.add.at(newDP, R + 1, -cnt) dp = np.cumsum(newDP) % mod dp = np.cumsum(dp) % mod print((dp[n] - dp[n - 1]) % mod)