func_code_string: #include <bits/stdc++.h>   using namespace std;   int f[200010], fi[200010];   const int MOD = 1e9 + 7;   int add(long long a, long long b) { return (a + b) % MOD; }   int mul(long long a, long long b) { return (a * b) % MOD; }   int fp(long long a, int b) {     if (b == 0) return 1;     int tp = fp(a, b >> 1);     tp = mul(tp, tp);     if (b & 1)       return mul(tp, a);     else       return tp;   }   int comb(int n, int k) {     if (k > n) return 0;     return mul(f[n], mul(fi[n - k], fi[k]));   }   int h, w, n, dp[2010];   vector<pair<int, int> > v;   int main() {     f[0] = fi[0] = 1;     for (int i = 1; i <= 200002; i++) {       f[i] = mul(i, f[i - 1]);       fi[i] = fp(f[i], MOD - 2);     }     scanf( %d%d%d , &h, &w, &n);     v.resize(n);     for (int i = 0; i < n; i++) {       scanf( %d%d , &v[i].first, &v[i].second);     }     sort(v.begin(), v.end());     v.emplace_back(h, w);     for (int i = 0; i <= n; i++) {       dp[i] = comb(v[i].first + v[i].second - 2, v[i].first - 1);       for (int j = 0; j < i; j++) {         if (v[j].first <= v[i].first && v[j].second <= v[i].second) {           dp[i] =               add(dp[i],                   -mul(comb(v[i].first + v[i].second - (v[j].first + v[j].second),                             v[i].first - v[j].first),                        dp[j]));           if (dp[i] < 0) dp[i] += MOD;         }       }     }     printf( %d n , dp[n]);     return 0;   }   