101715: [AtCoder]ABC171 F - Strivore

Memory Limit:256 MB Time Limit:2 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

Score: $600$ points

Problem Statement

How many strings can be obtained by applying the following operation on a string $S$ exactly $K$ times: "choose one lowercase English letter and insert it somewhere"?

The answer can be enormous, so print it modulo $(10^9+7)$.

Constraints

  • $K$ is an integer between $1$ and $10^6$ (inclusive).
  • $S$ is a string of length between $1$ and $10^6$ (inclusive) consisting of lowercase English letters.

Input

Input is given from Standard Input in the following format:

$K$
$S$

Output

Print the number of strings satisfying the condition, modulo $(10^9+7)$.


Sample Input 1

5
oof

Sample Output 1

575111451

For example, we can obtain proofend, moonwolf, and onionpuf, while we cannot obtain oofsix, oofelevennn, voxafolt, or fooooooo.


Sample Input 2

37564
whydidyoudesertme

Sample Output 2

318008117

Input

题意翻译

对于字符串 $S$ ,进行 $K$ 次下列操作可以变成多少个不同的字符串。 - 向任意位置插入一个小写英文字符。 答案可能很大,输出答案 $\bmod 10 ^ 9 +7$ 。 by [djh123456](https://www.luogu.com.cn/user/367575) 。

加入题单

上一题 下一题 算法标签: