func_code_string: #include <bits/stdc++.h>   using namespace std;   const long long mod = 1000000007;   const int N = 100005;   long long f[N];   long long inverse(long long x) {     if (x >= mod) return inverse(x % mod);     assert(x != 0);     if (x == 1) return 1;     return inverse(mod % x) * (mod - mod / x) % mod;   }   int main() {     ios::sync_with_stdio(false);     cin.tie(NULL);     int n;     cin >> n;     vector<long long> a(n);     long long sum = 0;     for (auto &x : a) {       cin >> x;       sum += x;     }     f[0] = 0;     f[1] = ((sum - 1) * (sum - 1) % mod) * inverse(sum) % mod;     for (int m = 2; m < N && m < sum; m++) {       f[m] = 2 * f[m - 1] - f[m - 2] - ((sum - 1) * inverse(sum - m + 1) % mod);       f[m] %= mod;       if (f[m] < 0) f[m] += mod;     }     long long ans = 0;     for (auto x : a) {       ans += f[x];     }     ans %= mod;     cout << ans <<   n ;     return 0;   }   