N = int(input()) x = list(map(int,input().split())) P = 10 ** 9 + 7 t = 0 X = sum(x) r = pow(X,P-2,P) rr = pow(X - 1,P-2,P) rrr = pow(2,P-2,P) for a in x: t += a * (a - 1) % P * rr % P * r % P t %= P t = (1 - t) % P print((t * (sum(x)-1) + 1) % P)