- Time limit: 1.00 s
- Memory limit: 512 MB
You are given a string of length that is going to be padded with characters A-Z in both ends until it's length becomes . Calculate the number of different padded strings.
Input
The first input line contains an integer shows the length of the final string. The second line has a pattern of length .
Output
Print the number of strings modulo .
Constraints
Example 1
Input:
6 ABCDB
Output:
52
Explanation: The final string will be of the form ABCDB or ABCDB where is any character between A–Z.
Example 2
Input:
100 YWANYWAZYWANYWA
Output:
134837038