Python Elegant & Short | One line)
If you like this solution remember toupvote itto let me know.
```python []
from collections import Counter
from math import perm, prod


class Solution:
    def countAnagrams(self, string: str) -> int:
        count = 1

        for word in string.split():
            count *= perm(len(word)) // prod(map(perm, Counter(word).values()))
            count %= 1_000_000_007

        return count
```

If you like this solution remember to **upvote it** to let me know.
['Combinatorics', 'Python', 'Python3']