#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]; for (int i = 0; i < M; i++) dp[K][i] = (N <= R[i]) ? 1 : 0; auto solve = [&](auto f, int k, int m) { if (dp[k][m] >= 0) return dp[k][m]; long long r = 0LL; for (int i = 0; i < M; i++) if (min(R[m], R[i]) >= max(L[m], L[i])) r = (r + f(f, k + 1, i) * (min(R[m], R[i]) - max(L[m], L[i]) + 1) % 1000000007) % 1000000007;; dp[k][m] = r; return r; }; long long r = 0; for (int i = 0; i < M; i++) if (1 >= L[i]) r = (r + solve(solve, 1, i)) % 1000000007; cout << r << endl; return 0; }