N = int(input()) mod = 10 ** 9 + 7 X = list(map(int, input().split())) S = sum(X) inv = pow(S, mod - 2, mod) ans = S for i in range(N): ans -= X[i] * (X[i] - 1) * inv ans %= mod print(ans)