Gats's Mirror Yarn
Gats owns a piece of yarn made from physically distinct knots. Each knot has one lowercase English letter written on it. Different knots may carry the same letter.
Gats unties all the knots and then chooses uniformly at random one of the possible orders of the distinct knots. He ties them together in that order.
A nonempty contiguous segment from position through position , where , is called a mirror patch if its sequence of letters reads the same from left to right and from right to left. Equivalently, for every integer satisfying , the letters at positions and must be equal.
Gats's score is the total number of mirror patches in the resulting yarn. Segments with different endpoint pairs are counted separately, even if their letter sequences are equal.
Find the expected value of Gats's score modulo .
Input
The first line contains an integer , the number of knots.
The second line contains a string of length . For every satisfying , the character is a lowercase English letter written on the -th knot.
Output
Let the expected score, written as a reduced fraction, be . Print the unique integer satisfying and where and is the multiplicative inverse of modulo .
Samples
Sample 1
Input
3 abc
Output
3
Because the three letters are different, every ordering has exactly three mirror patches, each consisting of one knot.
Sample 2
Input
5 aaabc
Output
299473313
The expected score is . Its required representation modulo is .