Count how many distinct strings can be made from a given name by shifting distinct positions total s, each shift 1 to 25.
Medium7CombinatoricsDynamic programmingMathNo attempts yetTime limit1sMemory limit256 MBA contest was delayed because of a mistake in uploading the problems. It was not really an upload mistake, though. It was the work of Junoh Lim, a grumpy hacker who lives in Dongtan! Wookje would not show Junoh a funny picture, so Junoh got grumpy and tried to wreck Wookje's contest.

Junoh encrypted the problem names so that the judge server cannot find the problems. A problem name consists of lowercase letters only. The encryption works as follows.
Wookje wants to prepare a rainbow table so that he can quickly recover encrypted problems later, even without knowing the original names. Given the original name of a problem, find the number of distinct names it can turn into and tell Wookje!
The first line contains s (1≤s≤3000). The second line contains the problem name, made of lowercase letters, whose length L satisfies 1≤L≤3000. The problem name contains no spaces. No impossible input is given, such as one with 25L<s.
Print the number of possible encrypted problem names modulo 1000000007.
In the first example, changing ab by a total of 2 gives ad, bc, and cb, so there are 3 ways.
In the second example, changing hanjo by a total of 2 gives janjo, hcnjo, hapjo, hanlo, hanjq, ibnjo, iaojo, ianko, …, haojp, and hankp, so there are 15 ways.