#include using namespace std; using ll = long long; int main() { const ll MOD = 1e9 + 7; int N, M, K; cin >> N >> M >> K; vector L(M); vector R(M); for (int i = 0; i < M; ++i) { cin >> L[i] >> R[i]; } vector> dp(K + 1, vector(N + 2, 0)); dp[0][1] = 1; for (int k = 1; k <= K; ++k) { for (int i = 1; i <= N; ++i) { (dp[k - 1][i] += dp[k - 1][i - 1]) %= MOD; } for (int i = 0; i < M; ++i) { ll t = (dp[k - 1][R[i]] - dp[k - 1][L[i] - 1]) % MOD; dp[k][L[i]] = (dp[k][L[i]] + t) % MOD; dp[k][R[i] + 1] = (dp[k][R[i] + 1] - t + MOD) % MOD; } for (int i = 1; i <= N; ++i) { (dp[k][i] += dp[k][i - 1]) %= MOD; } } cout << dp[K][N] % MOD << endl; return 0; }