Problem:
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

Solution in C++ (GCC 9.2.1) (judge verdict: Accepted)

#include<iostream>
#include<algorithm>
#include<cstdio>

using namespace std;
typedef long long ll;
const int mod = 1e9 + 7;
const int N = 2e6 + 10;

int fact[N], infact[N];

int qmi(int a, int b)
{
	int res = 1;
	while(b)
	{
		if(b & 1)	res = (ll)res * a % mod;
		a = (ll)a * a % mod;
		b >>= 1;
	}
	return res;
}

void init()
{
	fact[0] = 1, infact[0] = 1;
    for(int i = 1; i < N; ++i)
    {
        fact[i] = (ll)fact[i - 1] * i % mod;
        infact[i] = (ll)infact[i - 1] * qmi(i, mod - 2) % mod;
    }
}

ll C(int a, int b)
{
	return (ll)fact[a] * infact[b] % mod * (ll)infact[a - b] % mod;
}

int main()
{
	int k;
	string s;
	cin >> k >> s;
	
	int len = s.length();
	int n = k + len;
	init();						// 预处理阶乘 
	
	ll ans = 0;
	for(int i = len; i <= n; i++)
	{
		ll t = C(i - 1, len - 1) * qmi(25, i - len) % mod * (ll)qmi(26, n - i) % mod;
		ans = (ans % mod + t % mod) % mod;
	}
	cout << ans << endl;
	return 0;
}