MOD = 10 ** 9 + 7 n, m, k = map(int, input().split()) lr = [list(map(int, input().split())) for _ in range(m)] dp = [0] * (n + 1) dp[0] = 1 for _ in range(k): cum = [0] for d in dp[:-1]: cum.append(cum[-1] + d) if cum[-1] >= MOD: cum[-1] -= MOD ndp = [0] * (n + 1) for l, r in lr: plus = (cum[r] - cum[l - 1]) % MOD ndp[l - 1] += plus ndp[r] -= plus for i in range(1, n + 1): ndp[i] += ndp[i - 1] ndp[i] %= MOD dp = ndp print(dp[n - 1])