C++ ,Simple with explanation , Easy ...
Intuition\nSimple Permuataion formaul\n\nfor duplicate = !N / !D1*!D2\n\nwhere d1 and d2 duplicate for character in aab , d1=2,d2=1\n\n# Code\n\n\ntypedef long 
# Intuition\nSimple Permuataion formaul\n\nfor duplicate = !N / !D1*!D2\n\nwhere d1 and d2 duplicate for character in aab , d1=2,d2=1\n\n# Code\n```\n\ntypedef long long int lli;\nint MOD=1e9+7;\n\nclass Solution {\n\n\npublic:\n\n    int power(lli x, lli y) {\n        lli res = 1;\n        x = x % MOD; // Take modulo to avoid overflow\n        while (y > 0) {\n            if (y & 1) res = (res * x) % MOD;\n            y = y >> 1;\n            x = (x * x) % MOD;\n        }\n        return res;\n    }\n\n    int countAnagrams(string s) \n    {\n        \n        vector<lli> fact(s.length()+1,1);\n        for(int i=1;i<fact.size();i++)\n            {\n                fact[i]=fact[i-1]*i;\n                fact[i]%=MOD;\n            }\n\n        s+=" ";\n        lli res=1;\n        vector<int> hash(26,0);\n\n        for(int i=0;i<s.length();i++)\n        {\n            if(s[i]==\' \'){\n \n                lli d=0;\n                lli r=1;\n\n                for(int i=0;i<26;i++)\n                    if(hash[i])\n                    {\n                        r*=fact[hash[i]];\n                        d+=hash[i];\n                        r%=MOD;\n                    }\n        \n                d=fact[d];                \n                lli inverse_r = power(r, MOD - 2);\n                res *= d * inverse_r % MOD;\n                res%=MOD;\n\n                hash.assign(26,0);\n            }\n            else {\n                hash[s[i]-\'a\']++;\n            }\n        } \n\n        return res%MOD;\n    }\n};\n```
['C++']