#include #include using namespace std; using namespace atcoder; using mint = modint1000000007; using ll = long long; using vi = vector; using vs = vector; using vvi = vector; using vll = vector; using vvll = vector; using pii = pair; using pll = pair; #define rep(i,j,n) for(ll i=j;i> n; if (n == 1) { cout << 1; return 0; } mint kosu = 0; vll a(n); rp(i, n) { cin >> a[i]; kosu += a[i]; } mint sr = 0; rp(i, n) { sr+= a[i] * (a[i] - 1); } mint x =kosu; mint y = (kosu - 1) * sr; y/= (kosu * (kosu - 1)); x -= y; cout << x.val(); }