#include #define MAX 100100 typedef long long LL; const int INF=1000000007; int GCDW(int a, int b, LL & l, LL & k) { if (!a) { l = 0; k = 1; return b; } int d = GCDW(b % a, a, k, l); l -= (b / a) * k; return d; } int RevMod(int a, int m){ LL x, y; if (GCDW(a, m, x, y) != 1) return -1; x %= m; if (x < 0) x += m; return x; } int main() { char c[MAX]; int i,j,len,t[MAX][26],u[26]; int sil[MAX],invsil[MAX]; sil[0]=1; for(i=1;2*i<=MAX;++i) { sil[i]=(LL)i*sil[i-1]%INF; invsil[i]=RevMod(sil[i],INF); } invsil[0]=1; scanf("%s",c); for(i=0;i<26;++i) t[0][i]=0; for(len=0;c[len];++len); for(i=0;i>=1; y+=u[i]; z=(LL)z*invsil[u[i]]%INF; } // printf("%d %d %d %d\n",x,y,z,sil[y]); if(x==0) x=1; printf("%lld\n",(LL)sil[y]*z%INF*x%INF); } }