func_code_string: #include <bits/stdc++.h>   using namespace std;   const int mod = 1000000007;   inline int add(int a, int b) {     if ((a += b) >= mod) a -= mod;     return a;   }   inline int mult(int a, int b) {     long long t = 1ll * a * b;     if (t >= mod) t %= mod;     return t;   }   inline int dec(int a, int b) {     if ((a -= b) < 0) a += mod;     return a;   }   inline int power(int a, int b) {     int out = 1;     while (b) {       if (b & 1) out = mult(out, a);       a = mult(a, a);       b >>= 1;     }     return out;   }   int n, a[2510], f[100010], ans, mx, sum;   int main() {     scanf( %d , &n);     for (int i = 1; i <= n; i++) scanf( %d , &a[i]), sum += a[i];     mx = *max_element(a + 1, a + n + 1);     f[1] = mult(mult(sum - 1, sum - 1), power(sum, mod - 2));     for (int i = 1; i < mx; i++)       f[i + 1] = dec(add(f[i], f[i]),                      add(f[i - 1], mult(sum - 1, power(sum - i, mod - 2))));     for (int i = 1; i <= n; i++) ans = add(ans, f[a[i]]);     printf( %d n , ans);     return 0;   }   