#define _USE_MATH_DEFINES #include #include #include #include #include #include #include #include #include #include #include ///////// #define REP(i, x, n) for(int i = x; i < n; i++) #define rep(i,n) REP(i,0,n) #define P(p) cout<<(p)<>str; int N = str.size(); int s[26]; rep(i,26)s[i]=0; rep(i,N){ ++s[ str[i] - 'A' ]; } sort(s,s+26); LL ans=1; int nokori = N; rep(i,26){ ans *= ccc( nokori,s[i] ); ans %= mod;//mod nokori -= s[i]; } P(ans-1); return 0; }