Number of string permutations that are palindromes Your input will be a string consisting of small english letters.

Your task is to determine the number of distinct permutations of the original string that are a palindrome.

The input string has up to 100 letters. In the case of a longer string the result might be very big so the output should be the number of permutations modulo 666013.

For example,

cababaa -&gt; 3


The possible permutations are:

aabcbaa
abacaba
baacaab


This is code-golf, so the shortest answer wins!
Brachylog (2), 15 bytes

{p.↔}ᶠdl%₆₆₆₀₁₃


Try it online!

Explanation

{p.↔}ᶠdl%₆₆₆₀₁₃
{   }ᶠdl          Count (l) the number of distinct (d) results (ᶠ) obtainable by:
 p                  permuting {the input}
  .                 to produce an output
   ↔                that, if reversed, is still the output
        %₆₆₆₀₁₃   then take that number modulo 666013