Code Submission Evaluation System | Login |

**Task** | Statistics

Time limit: | 1.00 s | Memory limit: | 512 MB |

Your task is to calculate the number of strings of length $n$ whose substring is a given string of length $m$. All strings consist of characters A–Z.

The first input line has an integer $n$: the length of the final string.

The second line has a string of length $m$.

Print the number of strings modulo $10^9+7$.

- $1 \le n \le 1000$

- $1 \le m \le 100$

Input:

`6`

ABCDB

Output:

`52`

Explanation: The final string will be of the form ABCDB$x$ or $x$ABCDB where $x$ is any character between A–Z.