Python (Simple Maths)
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time 
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nclass Solution:\n    def countAnagrams(self, s):\n        mod = 10**9+7 \n\n        def function(t):\n            n, dict1, v = len(t), Counter(t), 1\n\n            for key,val in dict1.items():\n                v = v*math.factorial(val)\n\n            return math.factorial(n)//v \n\n        ans, count = s.split(), 1 \n\n        for i in ans:\n            count *= function(i)\n\n        return count%mod \n```
['Python3']