#include using namespace std; #include using mint = atcoder::modint1000000007; array cnt; int main() { string s; cin >> s; int n = s.size(); vector fac(n + 1, 1); for(int i = 1; i <= n; i++) fac[i] = i * fac[i - 1]; for(const auto &c : s) cnt[c - 'a']++; mint res = fac[n]; for(auto &v : cnt) res /= fac[v]; cout << res.val() << endl; return 0; }