func_code_string: #include <bits/stdc++.h>   using namespace std;   const int MOD = 1e9 + 7, LIM = 1e5;   unsigned long long int fact[2 * LIM + 1];   unsigned long long int binpow(long long int x, int y) {     unsigned long long int res = 1;     while (y > 0) {       if (y & 1) res = (res * x) % MOD;       y >>= 1;       x = (x * x) % MOD;     }     return res;   }   unsigned long long int inv_mod(unsigned long long int n) {     return binpow(n, MOD - 2);   }   unsigned long long int com(int n, int r) {     return (((fact[n] * inv_mod(fact[r])) % MOD) * inv_mod(fact[n - r])) % MOD;   }   bool comp(pair<int, int> p, pair<int, int> q) {     if (p.first == q.first) return p.second < q.second;     return p.first < q.first;   }   int main() {     fact[0] = 1;     for (int i = 1; i <= 2 * LIM; i++) {       fact[i] = (i * fact[i - 1]) % MOD;     }     int h, w, n;     cin >> h >> w >> n;     vector<pair<int, int>> pts(n + 1);     for (int i = 0; i < n; i++) {       int r, c;       cin >> r >> c;       pts[i] = {r, c};     }     pts[n] = {h, w};     sort(pts.begin(), pts.end(), comp);     unsigned long long int dp[n + 1];     for (int i = 0; i <= n; i++) {       dp[i] = com(pts[i].first + pts[i].second - 2, pts[i].first - 1);       for (int j = 0; j < i; j++) {         if (pts[j].first <= pts[i].first && pts[j].second <= pts[i].second) {           dp[i] = (dp[i] + MOD -                    (dp[j] * com(pts[i].first - pts[j].first + pts[i].second -                                     pts[j].second,                                 pts[i].first - pts[j].first)) %                        MOD) %                   MOD;         }       }     }     cout << dp[n];   }   