#include using namespace std; using PP = pair; const int INF = 1e9; template T Next() { T t; cin >> t; return t; } const int mod = 1000000007; int n, m, k; int dp[3001][3001]; int dq[3000][3001]; int l[3000]; int r[3000]; int main() { cin >> n >> m >> k; for (int j = 0; j < m; ++j) { cin >> l[j] >> r[j]; --l[j]; } dp[0][0] = 1; for (int q = 0; q < k; ++q) { for (int i = 0; i < n; ++i) { dq[q][i + 1] = (dq[q][i] + dp[q][i]) % mod; } for (int j = 0; j < m; ++j) { int add = (dq[q][r[j]] + mod - dq[q][l[j]]) % mod; dp[q + 1][l[j]] = (dp[q + 1][l[j]] + add) % mod; dp[q + 1][r[j]] = (dp[q + 1][r[j]] + mod - add) % mod; } for (int i = 0; i < n; ++i) { dp[q + 1][i + 1] = (dp[q + 1][i + 1] + dp[q + 1][i]) % mod; } } cout << dp[k][n - 1] << endl; }