#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 l[3000]; int r[3000]; vector sub(const vector& curr) { vector tmp(n + 1); for (int i = 0; i < n; ++i) { tmp[i + 1] = (tmp[i] + curr[i]) % mod; } vector next(n + 1); for (int j = 0; j < m; ++j) { int add = (tmp[r[j]] + mod - tmp[l[j]]) % mod; next[l[j]] = (next[l[j]] + add) % mod; next[r[j]] = (next[r[j]] + mod - add) % mod; } for (int i = 0; i < n; ++i) { next[i + 1] = (next[i + 1] + next[i]) % mod; } return next; } int main() { cin >> n >> m >> k; for (int j = 0; j < m; ++j) { cin >> l[j] >> r[j]; --l[j]; } vector curr(n + 1); curr[0] = 1; for (int z = 0; z < k; ++z) { curr = sub(curr); } cout << curr[n - 1] << endl; }