func_code_string: #include <bits/stdc++.h>   using namespace std;   long long fact[200010], cnt, cnt1[200010], cnt2[200010];   void precalc() {     fact[0] = 1;     for (int i = 1; i < 200010; i++) {       fact[i] = (i * fact[i - 1]) % 1000000007;     }   }   long long power(long long a, long long b, long long p) {     if (b == 0) return 1;     long long ret = power(a, b / 2, p);     ret = (ret * ret) % p;     if ((b % 2) == 1) ret = (ret * a) % p;     return ret % p;   }   long long ncr(long long n, long long r) {     if (n < r) {       return 0;     }     long long ans = fact[n];     long long den = (fact[n - r] * fact[r]) % 1000000007;     ans = (ans * power(den, 1000000007 - 2, 1000000007)) % 1000000007;     return ans;   }   int main() {     precalc();     string str;     cin >> str;     long long n = str.length();     cnt = 0;     long long ans = 0;     for (int i = 0; i < n; i++) {       if (str[i] ==  ( ) {         cnt++;       }       cnt1[i] = cnt;     }     cnt = 0;     for (int i = n - 1; i >= 0; i--) {       if (str[i] ==  ) ) {         cnt++;       }       cnt2[i] = cnt;     }     for (int i = 0; i < n; i++) {       if (str[i] ==  ( ) {         long long x = cnt1[i];         long long y = cnt2[i];         ans = (ans + ncr(x + y - 1, x)) % 1000000007;       }     }     cout << ans << endl;     return 0;   }   