K=int(input()) c=list(map(int,input().split())) C=sum(c) M=10**9+7 fa=[1,1] fb=[1,1] for i in range(2,C+1): fa+=[fa[-1]*i%M] fb+=[fb[-1]*(M//i)*fb[M%i]*fa[M%i-1]*(-1)%M] g=[0]*(C+1) for i in range(1,C+1): if C%i==0: a=1 for v in c: a*=fb[v//i]*(v%i==0) a%=M g[C//i]=a*fa[C//i]%M import math print(sum(g[math.gcd(i,C)] for i in range(1,C+1))*pow(C,M-2,M)%M)