JavaScript solution, need math knowledge and BigInt class
Intuition\nThe final result is from multipling each word result.\nFor a word (splitted by space), we count the frequence of characters and calculate result for 
# Intuition\nThe final result is from multipling each word result.\nFor a word (splitted by space), we count the frequence of characters and calculate result for that word.\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\nO(n)\n\n- Space complexity:\nO(n)\n\n# Code\n```\n/**\n * @param {string} s\n * @return {number}\n */\nvar countAnagrams = function (s) {\n  const BIGINT_MODULO = BigInt(Math.pow(10, 9) + 7);\n  function countWord(word) {\n    let map = new Map();\n    for (let c of word) {\n      let cnt = map.get(c) || 0;\n      cnt++;\n      map.set(c, cnt);\n    }\n\n    if (map.size === 1) return 1n;\n    else {\n      let finalResult = 1n;\n      let cnts = Array.from(map.values())\n        .sort((a, b) => a - b)\n        .map((val) => BigInt(val));\n      let sum = BigInt(word.length);\n      let choice = sum;\n\n      for (let i = 0; i < cnts.length - 1; i++) {\n        let cnt = cnts[i];\n        let combinations = 1n;\n        let devisor = 1n;\n        while (cnt > 0n) {\n          combinations *= choice--;\n          devisor *= cnt;\n          cnt--;\n        }\n        finalResult *= combinations / devisor;\n      }\n\n      return finalResult;\n    }\n  }\n\n  let ans = 1n;\n  for (let word of s.split(" ")) {\n    ans *= countWord(word);\n    ans %= BIGINT_MODULO;\n  }\n\n  return Number(ans);\n};\n\n```
['JavaScript']