func_code_string: #include <bits/stdc++.h>   using namespace std;   const long long p = 1e9 + 7;   int n, a[2505], mx, s, ch, ans;   long long f[100005];   long long ksm(long long x, int y) {     long long sun = 1;     x %= p;     while (y) {       if (y & 1) sun = sun * x % p;       y >>= 1;       x = x * x % p;     }     return sun;   }   int main() {     cin >> n;     for (int i = 1; i <= n; i++)       scanf( %d , &a[i]), mx = max(a[i], mx), s += a[i];     f[1] = ksm(s - 1, 2) * ksm(s, p - 2) % p;     ch = f[1];     for (int i = 2; i <= mx; i++) {       ch = (ch - ksm(s - i + 1, p - 2) * (s - 1) % p + p) % p;       f[i] = (f[i - 1] + ch) % p;     }     for (int i = 1; i <= n; i++) ans = (ans + f[a[i]]) % p;     cout << ans;   }   