#include using namespace std; const long long mod = 1000000007; long long N, M, K, L[3009], R[3009], dp[3009][3009]; int main() { cin >> N >> M >> K; for (int i = 1; i <= M; i++) cin >> L[i] >> R[i]; for (int i = 1; i <= N; i++) dp[0][i] = 1; for (int i = 0; i < K; i++) { for (int j = 1; j <= M; j++) { long long E = dp[i][R[j]] - dp[i][L[j] - 1] + mod; E %= mod; dp[i + 1][L[j]] += E; dp[i + 1][R[j] + 1] -= E; } for (int j = 1; j <= N; j++) { dp[i + 1][j] += dp[i + 1][j - 1]; dp[i + 1][j] %= mod; } for (int j = 1; j <= N; j++) { dp[i + 1][j] += dp[i + 1][j - 1]; dp[i + 1][j] %= mod; } } cout << (dp[K][N] - dp[K][N - 1] + mod) % mod << endl; return 0; }