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): a=1 for v in c: if v%i==0: a*=fb[v//i] a%=M else: a=0 g[i]=a*fa[C//i]%M from math import gcd print(sum(g[C//gcd(i,C)] for i in range(1,C+1))*pow(C,M-2,M)%M)