Python 3 | Solution
Code\n\nclass Solution:\n    def countAnagrams(self, s: str) -> int:\n        \n        res = 1\n        mod = 10**9 + 7\n\n        def count_anagram(word):\n\n
# Code\n```\nclass Solution:\n    def countAnagrams(self, s: str) -> int:\n        \n        res = 1\n        mod = 10**9 + 7\n\n        def count_anagram(word):\n\n            D = Counter(word)\n            res = math.factorial(len(word))\n\n            for x in D.values():\n                res //= math.factorial(x)\n            \n            return res%mod\n\n\n        \n        for x in s.split(" "):\n            res *= count_anagram(x)\n            res %= mod\n\n        return res\n```
['Hash Table', 'Math', 'String', 'Combinatorics', 'Counting', 'Python3']