Harryxun/sft_time huggingface dataset:
### BUGGY CODE ###

def max_heapify(a, i):
    h = len(a)
    l = 2 * i + 1
    r = 2 * i + 2
    if l < h and a[l] > a[i]:
        largest = l
    else:
        largest = i
    if r < h and a[r] > a[largest]:
        largest = r

    if largest != i:
        tmp = a[i]
        a[i] = a[largest]
        a[largest] = tmp
        max_heapify(a, largest)


def build_max_heap(a):
    h = len(a)
    for i in range(h // 2 - 1, -1, -1):
        max_heapify(a, i)


heap = []
ans = []
while True:
    s = input().split()
    if s[0] == "end":
        break
    elif s[0] == "extract":
        build_max_heap(heap)
        ans.append(heap[0])
        heap = heap[1:]
        build_max_heap(heap)
    elif s[0] == "insert":
        heap.append(int(s[1]))

for x in ans:
    print(x)


### FIXED CODE ###

import sys


def extract_max(A):
    x = A[0]
    A[0] = A[-1]
    A.pop()
    H = len(A)
    i = 0
    while i < H:
        v = A[i]
        rv = 0
        lv = 0
        r = (i + 1) * 2
        l = r - 1
        if l < H:
            lv = A[l]
            if r < H:
                rv = A[r]

        if v < lv and lv > rv:
            A[l] = v
            A[i] = lv
            i = l
        elif v < rv:
            A[r] = v
            A[i] = rv
            i = r
        else:
            break
    return x


def insert(a, n):
    i = len(a)
    a.append(n)
    while i > 0:
        p = int((i + 1) / 2) - 1
        v = a[i]
        pv = a[p]
        if pv < v:
            a[p] = v
            a[i] = pv
            i = p
        else:
            break


def main():
    istr = sys.stdin.read()
    cmds = list(istr.splitlines())
    S = []
    for cmd in cmds:  # input()
        if cmd[0] == "i":
            insert(S, int(cmd[7:]))

        elif cmd == "extract":
            a = extract_max(S)
            print(a)

        elif cmd == "end":
            break


if __name__ == '__main__':
    main()
### BUGGY CODE ###

from collections import deque, defaultdict

N, K = (int(i) for i in input().split())  
P = [int(i) for i in input().split()] 

dice = [0]
for i in range(1000):
  dice.append(1 + 0.5 * i)

q = deque()
ans = 0
for p in P:
  q.append(dice[p])
  
  if len(q) < K:
    continue
  else:
    ans = max(ans, sum(q))
    q.popleft()

print(ans)

### FIXED CODE ###

from collections import deque, defaultdict

N, K = (int(i) for i in input().split())  
P = [int(i) for i in input().split()] 

dice = [0]
for i in range(1000):
  dice.append(1 + 0.5 * i)
  
lis = [0]
sum = 0
for p in P:
  sum += dice[p]
  lis.append(sum)
  
ans = 0
for i in range(N - K + 1):
  ans = max(ans, lis[K+i] - lis[i])
print(ans)
### BUGGY CODE ###

N = int(input())
L = [input() for i in range(N)]
l = list(set(L))
c = [L.count(j) for j in l]
C = max(c)
A = [l[k] for k in range(len(l)) if c[k] == C]
A.sort()
[print(l) for l in A]

### FIXED CODE ###

import collections
N = int(input())
l = [input() for i in range(N)]
L = collections.Counter(l)
a = L.most_common()
M = a[0][1]
A = [j[0] for j in a if j[1] == M]
[print(k) for k in sorted(A)]
### BUGGY CODE ###

n = int(input())
A = input().split()
b = []
for i,a in enumerate(A):
    if i%2==0:
        b.insert(0,a)
    else:
        b.append(a)
print(' '.join(reversed(b)) if len(b)%2==0 else ' '.join(b))

### FIXED CODE ###

n = int(input())
A = input().split()
if n%2==0:
    print(' '.join(A[1::2][::-1]),end=' ')
    print(' '.join(A[::2]))
else:
    print(' '.join(A[::2][::-1]),end=' ')
    print(' '.join(A[1::2]))
### BUGGY CODE ###

import sys
input = sys.stdin.readline

N,K=map(int,input().split())
p=list(map(int,input().split()))
t=0


for i in range(N-K+1):
  if sum(p[i:i+K])>t:
    t=sum(p[i:i+K])
    
print((K+t)/2)

### FIXED CODE ###

def main():
    """"ここに今までのコード"""
import sys
input = sys.stdin.readline

N,K=map(int,input().split())
p=list(map(int,input().split()))
t=0
k=sum(p[0:K])

if N==K:
  print((k+K)/2)
else:
  for i in range(N-K):
    k-=p[i]
    k+=p[i+K]
    if k>t:
      t=k
    
  print((K+t)/2)

if __name__ == '__main__':
    main()
### BUGGY CODE ###

def solve():
  N, K = map(int, input().split())
  A = [int(i) for i in input().split()]
  F = [int(i) for i in input().split()]

  rest = sum(A) - K
  if rest <= 0: return 0

  _min = min(F)
  cost = 0

  while True:
    _sum = sum([cost // f for f in F])
    if _sum >= rest: return cost
    cost += _min

print(solve())


### FIXED CODE ###

import numpy as np

def solve():
  N, K = map(int,input().split())
  A = np.array(input().split(), np.int64)
  F = np.array(input().split(), np.int64)

  A.sort()
  F.sort()
  F=F[::-1]
  a_sum = A.sum()
  low, high = -1, 10**13

  while low + 1 < high:
      mid = (low + high) // 2
      if np.minimum(A, mid // F).sum() >= a_sum - K:
          high = mid
      else:
          low = mid
  return high

print(solve())
### BUGGY CODE ###

S = input()
Q = int(input())
reverse_index = -1

for i in range(Q):
    query = input()
    query = query.replace(' ', '')
    if query[0] == '1':
        reverse_index *= -1
    elif query[0] == '2':
        if query[1] == '1':
            if reverse_index == -1:
                S = query[2] + S
            else:
                S = S + query[2]
        else:
            if reverse_index == -1:
                S = S + query[2]
            else:
                S = query[2] + S

if reverse_index == 1:
    print(S[::-1])
else:
    print(S)


### FIXED CODE ###

from collections import deque

S = deque(input())
Q = int(input())
reverse_index = -1

for i in range(Q):
    query = input()
    if query[0] == '1':
        reverse_index *= -1
    elif query[0] == '2':
        if query[2] == '1':
            if reverse_index == -1:
                S.appendleft(query[4])
            else:
                S.append(query[4])
        else:
            if reverse_index == -1:
                S.append(query[4])
            else:
                S.appendleft(query[4])

if reverse_index == 1:
    S.reverse()
    print(*S, sep='')
else:
    print(*S, sep='')
### BUGGY CODE ###

n = int(input())
A = list(map(int, input().split()))
Q = int(input())

for i in range(Q):
    b, c =map(int, input().split())
    A = [c if i == b else i for i in A]
    print(sum(A))

### FIXED CODE ###

from collections import Counter
n = int(input())
A = list(map(int, input().split()))
B = Counter(A)
ans = sum(A)
Q = int(input())

#print(B)
for i in range(Q):
    b, c =map(int, input().split())
    x = B[b]
    if x == 0:
        print(ans)
        continue
    if c in B:
        B[c] += x 
    else:
        B[c] = x
    B.pop(b)
    ans = ans + (c - b) * x
    #print(B)
    print(ans)
### BUGGY CODE ###

from collections import Counter


from operator import mul
from functools import reduce

def combinations_count(n, r):
    r = min(r, n - r)
    numer = reduce(mul, range(n, n - r, -1), 1)
    denom = reduce(mul, range(1, r + 1), 1)
    return numer // denom


S = input()
div = []
s = 0
for i in range(1, len(S) + 1):
    s += (int(S[-i]) * (10 ** (i - 1)))
    s %= 2019
    div.append(s)
div_cnt = Counter(div)
ans = div_cnt[0]
for l in div_cnt.values():
    if l >= 2:
        ans += l * (l-1) // 2
print(ans)


### FIXED CODE ###

from collections import Counter


from operator import mul
from functools import reduce

def combinations_count(n, r):
    r = min(r, n - r)
    numer = reduce(mul, range(n, n - r, -1), 1)
    denom = reduce(mul, range(1, r + 1), 1)
    return numer // denom


S = input()
div = []
s = 0
kurai = 1
for i in range(len(S) - 1, -1, -1):
    # s += int(S[i]) * ((10 ** (len(S) - 1 - i)) % 2019)
    # s %= 2019
    if i == len(S) - 1:
        s += int(S[i]) * kurai
    else:
        s += int(S[i]) * kurai
    kurai *= 10
    kurai %= 2019
    s %= 2019
    div.append(s)
div_cnt = Counter(div)
ans = div_cnt[0]
for l in div_cnt.values():
    if l >= 2:
        ans += l * (l-1) // 2
print(ans)
### BUGGY CODE ###

import numpy as np
n,m,q = map(int,raw_input().split())

imos = [[0 for i in xrange(n)] for j in xrange(n)]

for i in xrange(m):
	f,t = map(int,raw_input().split())
	f -= 1
	t -= 1
	for j in xrange(f+1):
		imos[j][t] += 1

for i in xrange(n):
	imos[i] = np.cumsum(imos[i])

for i in xrange(q):
	a,b = map(int,raw_input().split())
	print imos[a-1][b-1]


### FIXED CODE ###

import numpy as np
n,m,q = map(int,raw_input().split())

imos = [[0 for i in xrange(n)] for j in xrange(n)]

for i in xrange(m):
	f,t = map(int,raw_input().split())
	f -= 1
	t -= 1
	imos[f][t] += 1

for i in range(n-1,0,-1):
	for j in range(n):
		imos[i-1][j] = imos[i][j] + imos[i-1][j]

for i in xrange(n):
	imos[i] = np.cumsum(imos[i])

for i in xrange(q):
	a,b = map(int,raw_input().split())
	print imos[a-1][b-1]
### BUGGY CODE ###

import sys

N = int(input())
D = sorted(list(map(int,input().split())))

if N % 2 != 0:
    print(0)
    sys.exit()

low  = D[0:N//2]
high = D[N//2::]

cnt = 0
flg = True
for i in range(low[-1], min(high) + 1):
    flg = True
    for L in low:
        if i <= L:
            flg = False
    for L in high:
        if i > L:
            flg = False

    if flg == True:
        cnt = cnt + 1
print(cnt)



### FIXED CODE ###

import sys

N = int(input())
D = sorted(list(map(int,input().split())))

if N % 2 != 0:
    print(0)
    sys.exit()

low  = D[0:N//2]
high = D[N//2::]

flg  = all( low[-1] + 1 >  x for x in low )
flg |= all( high[0] - 1 >= x for x in high )

if flg == True:
    print(high[0] - low[-1])
else:
    print(0)
### BUGGY CODE ###

import math

n, d, a = map(int,input().split())
xh = []
for i in range(n):
    x,h = map(int,input().split())
    xh.append([x,h])

num = 0
xh.sort(key=lambda xh:xh[0])
x = []
h = []
for i in range(n):
    x.append(xh[i][0])
    h.append(xh[i][1])


while len(h) > 0.5:
    nat = math.ceil((h[0])/a)
    num += nat
    dam = nat*a
    for i in range(len(x)):
        if x[i] <= x[0]+2*d:
            h[i] -= dam
        else:
            break
    while len(h) > 0 and h[0] < 0.5:
        h.pop(0)
        x.pop(0)


print(num)


### FIXED CODE ###

import math

n, d, a = map(int,input().split())
xh = [[0 for i in range(2)] for j in range(n)]
left = [i for i in range(n)]
for i in range(n):
    x,h = map(int,input().split())
    xh[i] = [x,h]

num = 0
xh.sort(key=lambda xh:xh[0])

for i in range(n):
    for j in range(left[i-1],i):
        if xh[j][0]+d >= xh[i][0]-d:
            left[i] = j
            break

dam = [0]*n

def dsum(k):
    if k == 0:
        return 0
    elif left[k] == 0:
        return dam[k-1]
    else:
        return dam[k-1]-dam[left[k]-1]

for i in range(n):
    res = xh[i][1]-dsum(i)
    nat = max([math.ceil(res/a),0])
    dam[i] = dam[i-1]+a*nat
    if res > 0:
        num += nat

print(num)
### BUGGY CODE ###

from fractions import gcd
from itertools import accumulate

N = int(input())
L = list(map(int, input().split()))

m_gcd = 0
for i in range(N):
	Lt = L[:]
	Lt.pop(i)
	m_gcd = max(m_gcd, list(accumulate(Lt, gcd))[N - 2])

print(m_gcd)

### FIXED CODE ###

from fractions import gcd
from itertools import accumulate

N = int(input())
L = list(map(int, input().split()))

gcd_L = [0] + list(accumulate(L, gcd))
gcd_R = list(accumulate(L[::-1], gcd))[::-1] + [0]


# [0,1,2,3,4]
# [4,3,2,1,0]
# N = 4
m_gcd = 0

for i in range( N):
	m_gcd = max(m_gcd, gcd(gcd_L[i], gcd_R[i + 1]))
print(m_gcd)
### BUGGY CODE ###

N, K = [int(a) for a in input().split()]
A = [int(a) for a in input().split()]
marks = []

prev = 1
for k in range(K):
    prev = (prev * A[K-1-k])
# print(prev)

for i in range(K, N):
    # print('div', i, K, i-K)
    prod = A[i]*(prev//A[i-K])
    if prev != -1:
        if prev < prod:
            print('Yes')
        else:
            print('No')
    prev = prod

### FIXED CODE ###

N, K = [int(a) for a in input().split()]
A = [int(a) for a in input().split()]
marks = []

for i in range(K, N):
    prev = A[i-K]
    next_ = A[i]
    if prev < next_:
        print('Yes')
    else:
        print('No')
### BUGGY CODE ###

N, M = map(int, input().split())
L = [0] * M
R = [0] * M
LR = []
for i in range(M):
  L, R = map(int, input().split())
  LR.append(list(range(L, R+1)))
ans = set(LR[0])
for i in LR:
  ans = ans & set(i)
print(len(ans))

### FIXED CODE ###

N,M = map(int,input().split())
L = []
R = []
for i in range(M):
    l,r = map(int,input().split())
    L.append(l)
    R.append(r)
ans = list(range(max(L),min(R)+1))
print(len(ans))
### BUGGY CODE ###

K,S = list(map(int,input().split()))

counter = 0

for x in range(0,K+1):
	for y in range(0,K+1):
		for z in range(0,K+1):
			if(S == x+y+z):
				counter += 1

print(counter)

### FIXED CODE ###

K,S = list(map(int,input().split()))

counter = 0

for x in range(0,K+1):
	for y in range(0,K+1):
		if((S-x-y <= K) and (S-x-y >= 0)):
			counter += 1 

print(counter)
### BUGGY CODE ###

import sys
import math
import bisect
from sys import stdin,stdout
from math import gcd,floor,sqrt,log
from collections import defaultdict as dd
from bisect import bisect_left as bl,bisect_right as br

sys.setrecursionlimit(100000000)

ii     =lambda: int(input())
si     =lambda: input()
jn     =lambda x,l: x.join(map(str,l))
sl     =lambda: list(map(str,input().strip()))
mi     =lambda: map(int,input().split())
mif    =lambda: map(float,input().split())
lii    =lambda: list(map(int,input().split()))

ceil   =lambda x: int(x) if(x==int(x)) else int(x)+1
ceildiv=lambda x,d: x//d if(x%d==0) else x//d+1

flush  =lambda: stdout.flush()
stdstr =lambda: stdin.readline()
stdint =lambda: int(stdin.readline())
stdpr  =lambda x: stdout.write(str(x))

mod=1000000007


#main code
n=ii()
arr=lii()
sol=0
for i in range(n):
    for j in range(i+1,n):
        sol+=(arr[i]*arr[j])
print(sol%mod)

### FIXED CODE ###

import sys
import math
import bisect
from sys import stdin,stdout
from math import gcd,floor,sqrt,log
from collections import defaultdict as dd
from bisect import bisect_left as bl,bisect_right as br

sys.setrecursionlimit(100000000)

ii     =lambda: int(input())
si     =lambda: input()
jn     =lambda x,l: x.join(map(str,l))
sl     =lambda: list(map(str,input().strip()))
mi     =lambda: map(int,input().split())
mif    =lambda: map(float,input().split())
lii    =lambda: list(map(int,input().split()))

ceil   =lambda x: int(x) if(x==int(x)) else int(x)+1
ceildiv=lambda x,d: x//d if(x%d==0) else x//d+1

flush  =lambda: stdout.flush()
stdstr =lambda: stdin.readline()
stdint =lambda: int(stdin.readline())
stdpr  =lambda x: stdout.write(str(x))

mod=1000000007


#main code
def findProductSum(A, n): 
    array_sum = 0
    for i in range(0, n, 1): 
        array_sum = array_sum + A[i] 
    array_sum_square = array_sum * array_sum 
    individual_square_sum = 0
    for i in range(0, n, 1): 
        individual_square_sum += A[i] * A[i] 
    return (array_sum_square - 
            individual_square_sum)//2
n=ii()
arr=lii()
print(findProductSum(arr,n)%mod)
### BUGGY CODE ###

n = int(input())
a = list(map(int, input().split()))
mod = 10**9+7
result = [0 for _ in range(120)]
for i in a:
    x = format(i, "060b")[::-1]
    for j in range(60):
        result[j] = result[j]+(x[j]=="1")
result = [(n-i)*i for i in result]
for i in range(119):
    result[i+1] += result[i]//2
    result[i] = result[i]%2    
print(int("".join(map(str, result[::-1])), 2)%mod)

### FIXED CODE ###

import numpy as np
mod = 10**9+7
n = int(input())
a = np.fromstring(input(), dtype = np.int64, sep = ' ')

result = 0
for i in range(60):
    count_one = int((a&1).sum())
    result += count_one*(n-count_one)*(2**i)
    a >>= 1
print(result%mod)
### BUGGY CODE ###

A,V=map(int,input().split())

answer=1
for i in range(2,min(A,V)+1):
    if A%i==V%i==0:
        answer+=1
    while A%i==0:
        A/=i
    while V%i==0:
        V/=i
    if min(A,V)<i:
        break


print(answer)

### FIXED CODE ###

import fractions
A,B=map(int,input().split())
A,B=min(A,B),max(A,B)
g=fractions.gcd(A,B)
ans=1
for i in range(2,int(g**0.5+1)):
  if g%i==0:
    ans+=1
    while g%i==0:
      g/=i
    if g==1:
      break
if g!=1:
  ans+=1
print(ans)
### BUGGY CODE ###

n = int(input())
nums = list(map(int, input().split()))
if nums[0] == 1:
    print("1")
else:
    cnt = 1
    for i in range(1, n):
        if nums[i] < min(nums[:i]):
            cnt += 1
            if nums[i] == 1:
                break
    print(cnt)


### FIXED CODE ###

n = int(input())
nums = list(map(int, input().split()))
cnt = 1
min = nums[0]
for i in range(1, n):
    if nums[i] < min:
        min = nums[i]
        cnt += 1
print(cnt)
### BUGGY CODE ###

import numpy as np
from scipy.sparse.csgraph import dijkstra
from scipy.sparse import csr_matrix

N = int(input())
edge = np.array([tuple(map(int, input().split())) for _ in range(N - 1)]).T
Q, K = map(int, input().split())
query = [tuple(map(int, input().split())) for _ in range(Q)]

matr = csr_matrix((edge[2], (edge[0] - 1, edge[1] - 1)), (N, N))
way = tuple(dijkstra(matr, indices=K - 1, directed=False).astype(np.int64))
for x, y in query:
    print(way[x - 1] + way[y - 1])

### FIXED CODE ###

from collections import deque

N = int(input())

T = [[] for _ in range(N)]
for _ in range(N - 1):
    a, b, c = map(int, input().split())
    T[a - 1].append((b - 1, c))
    T[b - 1].append((a - 1, c))
Q, K = map(int, input().split())

# dfs
table = [0] * N
D = deque([K - 1])
visited = set()
while D:
    v = D.pop()
    visited.add(v)
    for x, d in T[v]:
        if x not in visited:
            table[x] = table[v] + d
            D.append(x)

for _ in range(Q):
    x, y = map(int, input().split())
    print(table[x - 1] + table[y - 1])
### BUGGY CODE ###

N=int(input())
A=[int(x) for x in input().split()]
l=[0]
c=0

if 1 not in A:
    print(-1)
    exit()


for i in range(N-1):
    for j in range(i+1,N):
        if A[i]>A[j]:
            continue
        else:
            if A[i] in l:
                continue
            if l[c]+1==A[i]:
                l.append(A[i])
                c+=1
if l[-1]+1 == A[-1]:
    l.append(A[-1])

print(N+1-len(l))


### FIXED CODE ###

N=int(input())
A=[int(x) for x in input().split()]
ne=1
c=0

if 1 not in A:
    print(-1)
    exit()


for i in range(N-1):
    if A[i]==ne:
        c+=1
        ne+=1
if A[-1]==ne:
    c+=1
print(N-c)
### BUGGY CODE ###

#!/usr/bin/env python3
n = int(input())
a = list(map(int, input().split()))
b = 1
ans = []
for i in range(n):
    ans.append(a.index(b) + 1)
    b += 1
for i in ans:
    print(i)

### FIXED CODE ###

#!/usr/bin/env python3
n = int(input())
a = list(map(int, input().split()))
ans = [0]*n
for i in range(n):
    ans[a[i] - 1] = i + 1
for j in ans:
    print(j)
### BUGGY CODE ###

# Problem E - Divisible Substring

from collections import Counter

# 組み合わせ
def combinations_count(n, r):
    return n * (n - 1) // r

# input
N, P = map(int, input().split())
S = list(input())

# count
if P==2 or P==5:
    ans = 0
    for i in range(N-1, -1, -1):
        s = int(S[i])
        if s%P==0:
            ans += i + 1
    # output
    print(ans)
else:
    p_nums = [0]*(N+1)
    for i in range(N-1, -1, -1):
        s = int("".join(S[i:]))
        p_nums[N - i] = s%P
    p_counter = Counter(p_nums)
    ans = 0
    for key in p_counter.keys():
        p_c = p_counter[key]
        if p_c>=2:
            ans += combinations_count(p_c, 2)
    print(ans)


### FIXED CODE ###

# Problem E - Divisible Substring

from collections import Counter

# input
N, P = map(int, input().split())
S = list(input())

# count
if P==2 or P==5:
    ans = 0
    for i in range(N-1, -1, -1):
        s = int(S[i])
        if s%P==0:
            ans += i + 1
    # output
    print(ans)
else:
    p_nums = [0]*(N+1)
    s = 0
    for i in range(N-1, -1, -1):
        s = int(S[i]) * pow(10, N - i - 1, P) + s
        p_nums[N - i] = s%P
    p_counter = [0]*P
    for i in range(N+1):
        p_counter[p_nums[i]] += 1
    ans = 0
    for i in range(P):
        ans += p_counter[i] * (p_counter[i] - 1) // 2
    print(ans)
### BUGGY CODE ###

'''
Created on 2020/08/28

@author: harurun
'''
def main():
  import sys
  pin=sys.stdin.readline
  pout=sys.stdout.write
  perr=sys.stderr.write
  
  n=int(pin())
  a=list(map(int,pin().split()))
  b=[]
  for i in a:
    b.append(i)
    b.reverse()
  for j in range(n):
    pout(f"{b[j]}")
    if j!=n-1:
      pout(" ")
  return 
main()
    

### FIXED CODE ###

'''
Created on 2020/08/28

@author: harurun
'''
def main():
  from collections import deque
  import sys
  pin=sys.stdin.readline
  pout=sys.stdout.write
  perr=sys.stderr.write
  
  n=int(pin())
  a=list(map(int,pin().split()))
  b=deque([])
  if n%2==0:
    for i in range(n):
      if i%2==0:
        b.append(a[i])
      else:
        b.appendleft(a[i])
  else:
    for j in range(n):
      if j%2==0:
        b.appendleft(a[j])
      else:
        b.append(a[j])
  for k in range(n):
    pout(str(b[k]))
    if k!=n-1:
      pout(" ")
  pout("\n")
  return 
main()
### BUGGY CODE ###

import sys
input = lambda: sys.stdin.readline().rstrip("\r\n")

mod = 10**9 + 7
k = int(input())
s = input()
n = len(s)

def make_tables(n, mod = 10 ** 9 + 7):
    fac = [1, 1] # 階乗テーブル
    finv = [1, 1] #逆元の階乗テーブル
    inv = [0, 1] #逆元テーブル

    for i in range(2, n + 1):
        fac.append((fac[-1] * i) % mod)
        inv.append((mod -inv[mod % i] * (mod // i)) % mod)
        finv.append((finv[-1] * inv[-1]) % mod)
    return fac, finv

def nCk(n, k, mod = 10 ** 9 + 7):
    k = min(k, n-k)
    return fac[n] * finv[k] * finv[n-k] % mod

##########################
fac, finv = make_tables(10**7)
ans = 0
for i in range(k + 1):
    temp = 1
    temp *= pow(26, i, mod)
    temp %= mod
    j = k - i
    if j == 0:
        ans += temp
        continue
    temp *= pow(25, j, mod)
    temp %= mod
    temp *= nCk(n + j - 1, n - 1)
    ans += temp
    ans %= mod
print(ans % mod)





### FIXED CODE ###

import sys
input = lambda: sys.stdin.readline().rstrip("\r\n")

mod = 10**9 + 7
k = int(input())
s = input()
n = len(s)

def make_tables(n, mod = 10 ** 9 + 7):
    fac = [1, 1] # 階乗テーブル
    finv = [1, 1] #逆元の階乗テーブル
    inv = [0, 1] #逆元テーブル

    for i in range(2, n + 1):
        fac.append((fac[-1] * i) % mod)
        inv.append((mod -inv[mod % i] * (mod // i)) % mod)
        finv.append((finv[-1] * inv[-1]) % mod)
    return fac, finv

def nCk(n, k, mod = 10 ** 9 + 7):
    k = min(k, n-k)
    return fac[n] * finv[k] * finv[n-k] % mod

##########################
fac, finv = make_tables(2*10**6 + 1)
ans = 0
for i in range(k + 1):
    temp = 1
    temp *= pow(26, i, mod)
    temp %= mod
    j = k - i
    if j == 0:
        ans += temp
        continue
    temp *= pow(25, j, mod)
    temp %= mod
    temp *= nCk(n + j - 1, n - 1)
    ans += temp
    ans %= mod
print(ans % mod)
### BUGGY CODE ###

N, K = map(int, input().split())
E = [set() for i in range(N+1)]
Er = []
for i in range(N-1):
    a, b = map(int, input().split())
    E[a].add(b)
    E[b].add(a)
    Er.append({a, b})
ma = 0
Start = []
if K&1 == 1:
    Start = Er
else:
    Start = [{i} for i in range(1, N+1)]
for st in Start:
    L = list(st)
    Closed = st
    for j in range(K//2):
        S = []
        for l in L:
            S += E[l]
        L = []
        for s in S:
            if s not in Closed:
                L.append(s)
                Closed.add(s)
    ma = max(ma, len(Closed))
print(N-ma)


### FIXED CODE ###

N, K = map(int, input().split())
E = [set() for i in range(N+1)]
Er = []
for i in range(N-1):
    a, b = map(int, input().split())
    E[a].add(b)
    E[b].add(a)
    Er.append({a, b})
ma = 0
Start = []
if K&1 == 1:
    Start = Er
else:
    Start = [{i} for i in range(1, N+1)]
for st in Start:
    L = list(st)
    Closed = st
    for j in range(K//2):
        S = []
        for l in L:
            S += E[l]
        L = []
        for s in S:
            if s not in Closed:
                L.append(s)
                Closed.add(s)
    ma = max(ma, len(Closed))
print(N-ma)
### BUGGY CODE ###

import sys

N = int(input())
A = list(map(int, input().split()))

for i in range(0, N, 1):
	for j in range(i + 1, N, 1):
		if A[i] == A[j]:
			print("NO")
			sys.exit(0)

print("YES")

### FIXED CODE ###

import sys

N = int(input())
A = list(map(int, input().split()))
A.sort()

for i in range(0, N - 1, 1):
	if A[i] == A[i + 1]:
		print("NO")
		sys.exit(0)

print("YES")