K=int(input()) c=list(map(int,input().split())) C=sum(c) M=10**9+7 fa=[1,1] for i in range(2,C+1): fa+=[fa[-1]*i%M] g=[0]*(C+1) for i in range(1,C+1): if C%i==0: a=1 for v in c: a*=pow(fa[v//i],M-2,M)*(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)