from fractions import Fraction
import math
def main():
    N = int(input())
    x = list(map(int, input().split()))
    j = 10**9 + 7
    s = 0
    for i in range(1,len(x)):
        s += x[i]
    ex_val = float(s)/float(N-1)
    fact = math.factorial(N-1)
    print(int(ex_val*fact)%j)

if __name__ == '__main__':
    main()