#include using namespace std; int main() { int N, M, K; cin>> N >> M >> K; vector L(M), R(M); vector> dp(3001, vector(3001, -1)); for (int i = 0; i < M; i++) cin >> L[i] >> R[i]; dp[K][N] = 1; for (int i = 0; i < N; i++) dp[K][i] = 0; auto solve = [&](auto f, int k, int n) { if (dp[k][n] >= 0) return dp[k][n]; int r = 0; for (int i = 0; i < M; i++) if (n >= L[i] && n <= R[i]) for (int j = L[i]; j <= R[i]; j++) r = (r + f(f, k + 1, j)) % 1000000007; dp[k][n] = r; return r; }; int r = 0; cout << solve(solve, 0, 1) << endl; return 0; }