~/algor $ cat problems/kombinatorika-sozlar-soni
Words from letters
Medium
1000 ms
128 MB
53%
A word $s$ is given. How many different words can be made by using all of its letters (each exactly once) and changing their order? A word need not be meaningful, and $s$ itself also counts. Print the answer modulo $10^{9} + 7$.
Input
One line with the word $s$.
Output
One integer — the number of words modulo $10^{9} + 7$.
Note
$1 \le |s| \le 10^{5}$
$s$ consists only of lowercase Latin letters (a–z)
Examples
Input #1
mama
Output #1
6
Input #2
a
Output #2
1