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

N = int(input())
e = list(map(int,input().split()))
mod = 1000000007
kai = [0]*(N+3)
#被り探し
for i in range(N):
  d = e[i]
  e[i] = e[i]+ 9999999
  try:
    f = e.index(d)
    break
  except:
    pass
e = []
g = i +0
for i in range(N+3):
  if i ==0:
    kai[i] = 1
  else:
    kai[i] = (kai[i-1]*(i))%mod
def comb(n,k,p):
  if n<0 or k<0 or n<k: return 0
  if n==0 or k==0: return 1
  a=kai[n] 
  b=kai[k] 
  c=kai[n-k] 
  b = pow(b,mod-2,mod)
  c = pow(c,mod-2,mod)
  return (a*b*c)%mod
h = [1]*((N+6)//2)
for j in range((N+4)//2):
  h[j+1] = comb(N+1,j+1,mod)
for j in range(N+1):
  if N-j>N/2:
    print(h[j+1]-comb(g+N-f,j,mod))
  else:
    print(h[N-j]-comb(g+N-f,j,mod))

### FIXED CODE ###

N = int(input())
e = list(map(int,input().split()))
mod = 1000000007
kai = [0]*(N+3)
from collections import Counter
c = Counter(e).most_common(1)[0][0]
g = e.index(c)
e.remove(c)
f = e.index(c) +1
e = []
for i in range(N+3):
  if i ==0:
    kai[i] = 1
  else:
    kai[i] = (kai[i-1]*(i))%mod
def comb(n,k,p):
  if n<0 or k<0 or n<k: return 0
  if n==0 or k==0: return 1
  a=kai[n] 
  b=kai[k] 
  c=kai[n-k] 
  b = pow(b,mod-2,mod)
  c = pow(c,mod-2,mod)
  return (a*b*c)%mod
h = [1]*((N+6)//2)
for j in range((N+4)//2):
  h[j+1] = comb(N+1,j+1,mod)
for j in range(N+1):
  if N-j>N/2:
    print((h[j+1]-comb(g+N-f,j,mod)+mod)%mod)
  else:
    print((h[N-j]-comb(g+N-f,j,mod)+mod)%mod)
### BUGGY CODE ###

N=int(input())
for n in range(1,N+1):
  n2 = int(n**0.5)+1
  cnt = 0
  for x in range(1,n2):
    for y in range(x,n2):
      for z in range(y,n2):
        #if n == 18:
          #print(x,y,z,x**2+y**2+z**2+x*y+y*z+z*x)
        if x**2+y**2+z**2+x*y+y*z+z*x != n:
          continue
        if x==y and y==z:
          cnt += 1
        elif x==y or y==z or z==x:
          cnt += 3
        else:
          cnt += 6
  print(cnt)

### FIXED CODE ###

N=int(input())
S = set([s**2 for s in range(2,int(N**0.5)+1)])
ans = [0]*(N+1)
for x in range(1,100):
  for y in range(1,100):
    for z in range(1,100):
      n = x*x+y*y+z*z+x*y+y*z+z*x
      if n<=N:
        ans[n]+=1
for v in ans[1:]:
  print(v)
### BUGGY CODE ###

import sys

N, Q = map(int, input().split())
S = input()
P = [[int(v) - 1 for v in sys.stdin.readline().split()] for _ in range(Q)]

for l, r in P:
    substr = S[l:r + 1]
    cnt = 0
    for i in range(len(substr) - 1):
        if substr[i:i + 2] == 'AC':
            cnt += 1
    print(cnt)


### FIXED CODE ###

import sys

N, Q = map(int, input().split())
S = input()
P = [[int(v) - 1 for v in sys.stdin.readline().split()] for _ in range(Q)]
X = [0] * (N + 1)

for i in range(N):
    if S[i:i + 2] == 'AC':
        X[i + 1] = X[i] + 1
    else:
        X[i + 1] = X[i] 


for l, r in P:
    print(X[r] - X[l])
### BUGGY CODE ###

#Nはお札の枚数、Yは合計金額
N,Y = map(int,input().split())

yukiti = 10000
higuti = 5000
noguti = 1000
l = []
flg = 0
for i in range(N+1):
    for j in range(N+1):
        for k in range(N+1):
            if (i + k + j) <= N:
                amount = yukiti*i + higuti*j + noguti*k
                if amount == Y:
                    l.append(i)
                    l.append(j)
                    l.append(k)
                    flg = 1
                    break

if flg == 1:
    print(l[0],l[1],l[2])
else:
    print(-1,-1,-1)

### FIXED CODE ###

#Nはお札の枚数、Yは合計金額
N,Y = map(int,input().split())

yukiti = 10000
higuti = 5000
noguti = 1000
re_yukiti = -1
re_higuti = -1
re_noguti = -1

for i in range(N+1):
    for j in range(N+1-i):
        k = N - i - j
        amount = yukiti*i + higuti*j + noguti*k
        if amount == Y:
            re_yukiti = i
            re_higuti = j
            re_noguti = k
            break

print(re_yukiti,re_higuti,re_noguti)
### BUGGY CODE ###

import sys

sys.setrecursionlimit(10 ** 6)
int1 = lambda x: int(x) - 1
p2D = lambda x: print(*x, sep="\n")
def MI(): return map(int, sys.stdin.readline().split())
def LI(): return list(map(int, sys.stdin.readline().split()))
def LLI(rows_number): return [LI() for _ in range(rows_number)]

def main():
    def dfs(i=0, j=0, s=-1):
        if s==-1:s=cc[0][0]
        if (i, j) == (h - 1, w - 1):
            return s
        res = inf
        for di, dj in [(1, 0), (0, 1)]:
            ni, nj = i + di, j + dj
            if ni == h or nj == w: continue
            res = min(res, abs(dfs(ni, nj, s + cc[ni][nj])))
            res = min(res, abs(dfs(ni, nj, s - cc[ni][nj])))
        return res

    inf = 10 ** 16
    h, w = MI()
    aa = LLI(h)
    bb = LLI(h)
    cc = [[a - b for a, b in zip(ar, br)] for ar, br in zip(aa, bb)]
    #p2D(cc)
    print(dfs())
main()


### FIXED CODE ###

import sys

sys.setrecursionlimit(10 ** 6)
int1 = lambda x: int(x) - 1
p2D = lambda x: print(*x, sep="\n")
def MI(): return map(int, sys.stdin.readline().split())
def LI(): return list(map(int, sys.stdin.readline().split()))
def LLI(rows_number): return [LI() for _ in range(rows_number)]

def bin_out(aa):
    bb = [format(a, "b") for a in aa]
    print(bb)

def main():
    h, w = MI()
    aa = LLI(h)
    bb = LLI(h)
    max_val=6400
    zero = 1 << max_val
    dp = [0] * w
    dp[0] = zero
    #bin_out(dp)
    for i, (ar, br) in enumerate(zip(aa, bb)):
        for j, (a, b) in enumerate(zip(ar, br)):
            d = abs(a - b)
            if j > 0: dp[j] |= dp[j - 1]
            dp[j] = dp[j] << d | dp[j] >> d
        #bin_out(dp)
    goal = dp[-1]
    for ans in range(max_val + 1):
        if goal & zero << ans or goal & zero >> ans:
            print(ans)
            break

main()
### BUGGY CODE ###

N = int(input())
a = list(map(int, input().split()))
c = 1
for i in a:
    c *= i
if c > (10 ** 18):
    print(-1)
else:
    print(c)

### FIXED CODE ###

import sys

input = sys.stdin.readline

N = int(input())
a = list(map(int, input().split()))
if 0 in a:
    print(0)
    exit()
c = 1
l = 10 ** 18
for i in a:
    c *= i
    if c > l:
        print(-1)
        exit()

print(c)
### BUGGY CODE ###

from fractions import gcd

K = int(input())

res = 0
tmp = 0
d = []
for i in range(1,K+1):
    for j in range(1,K+1):
        for k in range(1,K+1):
            if i == j and j == k:
                res += i
            elif i == j:
                res += gcd(i,k)
            elif i == k:
                res += gcd(j,k)
            elif j == k:
                res += gcd(i,j)
            else:
                res += gcd(gcd(i,j),k)
print(res)

### FIXED CODE ###

from math import gcd

K = int(input())

res = 0
for i in range(1,K+1):
    for j in range(1,K+1):
        tmp = gcd(i,j)
        for k in range(1,K+1):
            res += gcd(tmp,k)
print(res)
### BUGGY CODE ###

import numpy as np

N, K = map(int, input().split())
hs = np.array(list(map(int, input().split())))

i = 0
total_cost = 0
 
a = np.zeros(N, int)
a[0] = 0
a[1] = abs(hs[1] - hs[0])

for i in range(2, N):
    #a[i] = min(a[max(i-2,0)] + abs(hs[i] - hs[max(i-2,0)]),
    #           a[max(i-1,0)] + abs(hs[i] - hs[max(i-1,0)]))
    
    b = np.zeros(K, int)
    for j in range(K):
        b[j] = a[max(i-(j+1),0)] + abs(hs[i] - hs[max(i-(j+1),0)])
    a[i] = np.min(b)    
print(a[-1])

### FIXED CODE ###

import numpy as np

N, K = map(int, input().split())
hs = np.array(list(map(int, input().split())))

a = np.zeros(N, int)
a[0] = 0
a[1] = abs(hs[1] - hs[0])

if N == 2:
    print(a[-1])
else:
    for i in range(2, N):
        b = a[max(i-K,0):i] + np.abs(hs[i] - hs[max(i-K,0):i])
        a[i] = np.min(b)
    print(a[-1])
### BUGGY CODE ###

def main():
    import sys
    def MI():
        return map(int, sys.stdin.readline().rstrip().split())
    def LI():
        return list(map(int, sys.stdin.readline().rstrip().split()))  # 空白あり

    N, Q = MI()
    c = [{i} for i in LI()]

    seg = [set()] * (2*N)
    for i in range(N):
        seg[i+N] = c[i]
    for i in range(N-1,0,-1):
        seg[i] = seg[i << 1] | seg[i << 1 | 1]

    def fold(L, R):  # [L,R)の区間取得
        L += N
        R += N
        vL = set()
        vR = set()
        while L < R:
            if L & 1:
                vL = vL | seg[L]
                L += 1
            if R & 1:
                R -= 1
                vR = seg[R] | vR
            L >>= 1
            R >>= 1
        return len(vL | vR)

    for i in range(Q):
        l, r = MI()
        print(fold(l - 1, r))

if __name__ == '__main__':
    main()


### FIXED CODE ###

def main():
    import sys
    def MI():
        return map(int, sys.stdin.readline().rstrip().split())
    def LI():
        return list(map(int, sys.stdin.readline().rstrip().split()))  # 空白あり

    N,Q = MI()
    c = [0] + LI()
    lr = []
    for i in range(Q):
        l,r = MI()
        lr.append((i,l,r))

    from operator import itemgetter

    lr = sorted(lr,key=itemgetter(2))  # 右端rでソート
    a = 0
    d = {}  # d[i] = 玉iが現れた最も右の位置
    ANS = [0]*Q


    class BIT():
        def __init__(self, init_value):
            self.n = len(init_value)
            self.tree = [0] * (self.n + 1)
            for i in range(1, self.n + 1):
                x = init_value[i - 1]
                while i <= self.n:
                    self.tree[i] += x
                    i += i & (-i)

        def update(self, i, x):  # i(1-index)番目の値を+x
            while i <= self.n:
                self.tree[i] += x
                i += i & (-i)
            return

        def query(self, i):  # 1番目からi(1-index)番目までの和を返す
            res = 0
            while i > 0:
                res += self.tree[i]
                i -= i & (-i)
            return res


    bit = BIT([0]*N)  # 最も右に現れた玉の位置を管理
    for i in range(1,N+1):
        if not c[i] in d.keys():
            d[c[i]] = i
            bit.update(i,1)
        else:
            bit.update(d[c[i]],-1)
            d[c[i]] = i
            bit.update(i, 1)
        while a <= Q-1 and lr[a][2] == i:
            j,l,r = lr[a]
            ANS[j] = bit.query(r)-bit.query(l-1)
            a += 1

    print(*ANS,sep='\n')


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

import numpy as np
n,m = list(map(int,input().split()))
d = [[1<<n] for _ in range(m)]
s = 1<<0
for i in range(m):
  a,b = list(map(int,input().split()))
  d[i] = ((1<<a)-1) ^ ((1<<b)-1)

spr = [[False] for _ in range(m)]

ans = float('inf')
for bit in range(1<<n):
  spr = [True for _ in range(m)]
  for k in range(m):
      if (d[k] & bit) > 0:
        spr[k] = False
  if sum(spr) == 0:
      ans = min(ans, sum([1 for i in range(n) if bit & 1<<i]))

print(ans)
     


### FIXED CODE ###


n,m = list(map(int,input().split()))
d = [0]*m
spr = [True]*m
ma = 0
mi = 0
for i in range(m):
    a,b = list(map(int,input().split()))
    d[i] = [a,b]

d = sorted(d)
pre = d[0][1]
ans = 1
for i,(a,b) in enumerate(d):
  if a < pre:
    if b < pre:
      pre = b
  else:
    ans += 1
    pre = b

print(ans)
### BUGGY CODE ###

import sys
input = sys.stdin.readline
 
MOD = 10**9 + 7
def main():
    S = input()
    N = len(S)-1
 
    if S[0] == '?':
        dp = [1,1,1,1,1,1,1,1,1,1,0,0,0]
    else:
        dp = [0,0,0,0,0,0,0,0,0,0,0,0,0]
        dp[int(S[0])] = 1
 
    for i in range(1,N):
        dppre = dp
        dp = [0] * 13
 
        if S[i] == '?':
            for j in range(13):
                for k in range(10):
                    dp[(j * 10 + k) % 13 ] += dppre[j]
        else:
            for j in range(13):
                dp[(j * 10 + int(S[i])) % 13 ] += dppre[j]
 
        for j in range(13):
            dp[j] %= MOD
 
    print(dp[5])
if __name__ == '__main__':
    main()

### FIXED CODE ###

import sys
sys.setrecursionlimit(2**31-1)
input = sys.stdin.readline
write = sys.stdout.write
LMIIS = lambda : list(map(int,input().split()))
II = lambda : int(input())
dbg = lambda *something : print(*something) if DEBUG is True else 0
DEBUG = True



MOD = 10**9 + 7
class ModInt:

    def __init__(self, x):
        self.x = x.x if isinstance(x, ModInt) else x % MOD

    __str__ = lambda self:str(self.x)
    __repr__ = __str__
    __int__ = lambda self: self.x
    __index__ = __int__

    __add__ = lambda self, other: ModInt(self.x + ModInt(other).x)
    __sub__ = lambda self, other: ModInt(self.x - ModInt(other).x)
    __mul__ = lambda self, other: ModInt(self.x * ModInt(other).x)
    __pow__ = lambda self, other: ModInt(pow(self.x, ModInt(other).x, MOD))
    __mod__ = lambda self, other: ModInt(self.x % ModInt(other).x)
    __truediv__ = lambda self, other: ModInt(self.x * pow(ModInt(other).x, MOD - 2, MOD))
    __floordiv__ = lambda self, other: ModInt(self.x // ModInt(other).x)
    __radd__ = lambda self, other: ModInt(other + self.x)
    __rsub__ = lambda self, other: ModInt(other - self.x)
    __rpow__ = lambda self, other: ModInt(pow(other, self.x, MOD))
    __rmod__ = lambda self, other: ModInt(other % self.x)
    __rmul__ = lambda self, other: ModInt(other * self.x)
    __rtruediv__ = lambda self, other: ModInt(other * pow(self.x, MOD - 2, MOD))
    __rfloordiv__ = lambda self, other: ModInt(other // self.x)

    __lt__ = lambda self, other: self.x < ModInt(other).x
    __gt__ = lambda self, other: self.x > ModInt(other).x
    __le__ = lambda self, other: self.x <= ModInt(other).x
    __ge__ = lambda self, other: self.x >= ModInt(other).x
    __eq__ = lambda self, other: self.x == ModInt(other).x
    __ne__ = lambda self, other: self.x != ModInt(other).x


def main():
    S = input()

    dp = [[0] * 13  for _   in range(len(S)-1)]
    dp[0] = [ModInt(0) for _ in range(13)]
    
    if S[0] == '?':
        for i in range(10):
            dp[0][i] = ModInt(1)
    else:
        dp[0][int(S[0])] = ModInt(1)

    for i in range(1,len(S)-1):
        if S[i] == '?':
            for j in range(13):
                for k in range(10):
                    dp[i][(j * 10 + k) % 13 ] += dp[i-1][j]
        else:
            for j in range(13):
                dp[i][ (j* 10 + int(S[i])) % 13 ] += dp[i-1][j]
        

    print(dp[len(S)-2][5])









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

import numpy as np

N = int(input())
MAXX = 10**6 + 5
num = np.array(input().split(), np.int32)[:]
mark = np.zeros(MAXX, np.int32)

num = np.sort(num)
for n in num:
        mark[n::n] += 1

count = 0
for n in num:
    if mark[n] == 1:
        count += 1

print(count)

### FIXED CODE ###

import numpy as np

N = int(input())
MAXX = 10**6 + 5
num = np.array(input().split(), np.int32)[:]
mark = np.zeros(MAXX, np.int32)

num = np.sort(num)
for n in num:
    if mark[n] < 2:
        mark[n::n] += 1

count = 0
for n in num:
    if mark[n] == 1:
        count += 1

print(count)
### BUGGY CODE ###

from itertools  import product, permutations

N, C = map(int, input().split())

D = [list(map(int, input().split())) for _ in range(C)]

c = [list(map(lambda x: int(x)-1, input().split())) for _ in range(N)]

res = 1000*N*N

scores = [[0,0,0] for _ in range(C)]

for cc in range(C):
    for i,j in product(range(N), range(N)):
        if (i + j)%3 == 0:
            scores[cc][0] += D[c[i][j]][cc]
        if (i + j)%3 == 1:
            scores[cc][1] += D[c[i][j]][cc]
        if (i + j)%3 == 2:
            scores[cc][2] += D[c[i][j]][cc]



for c1, c2, c3 in permutations(range(C), 3):
    score = scores[c1][0] + scores[c2][1] + scores[c3][2]
    if res > score:
        res = score

print(res)



### FIXED CODE ###

from itertools  import product, permutations

N, C = map(int, input().split())

D = [list(map(int, input().split())) for _ in range(C)]

c = [list(map(lambda x: int(x)-1, input().split())) for _ in range(N)]

res = 1000*N*N

cnt = [[0]*C for _ in range(3)]


for i,j in product(range(N), range(N)):
    cnt[(i + j)%3][c[i][j]] += 1

for c1, c2, c3 in permutations(range(C), 3):
    score = 0
    for cc, cn in enumerate(cnt[0]):
        score += cn*D[cc][c1]
    for cc, cn in enumerate(cnt[1]):
        score += cn*D[cc][c2]
    for cc, cn in enumerate(cnt[2]):
        score += cn*D[cc][c3]
    if res > score:
        res = score

print(res)
### BUGGY CODE ###

def resolve():
    n = int(input())
    s = input()
    if len(set(s)) == 1:
        print(0)
    else:
        ans = min(s.count("."), s.count("#"))
        for i in range(n):
            if s[i:i + 2] == ".#":
                t = s[:i + 1].count("#") + s[i + 1:].count(".")
                if t < ans:
                    ans = t
        print(ans)


if __name__ == "__main__":
    resolve()


### FIXED CODE ###

def resolve():
    n = int(input())
    s = input()
    if len(set(s)) == 1:
        print(0)
    else:
        acc_w, acc_b = [], []
        w, b = 0, 0
        for i in range(n):
            if s[i] == ".":
                w += 1
            else:
                b += 1
            acc_w.append(w)
            acc_b.append(b)
        w = s.count(".")
        b = s.count("#")
        ans = min(w, b)
        for i in range(n - 1):
            if s[i] == "." and s[i + 1] == "#":
                t = acc_b[i] + w - acc_w[i]
                if t < ans:
                    ans = t
        print(ans)


if __name__ == "__main__":
    resolve()
### BUGGY CODE ###

from collections import defaultdict as dd
from copy import deepcopy as dc
N = int(input())
e = dd(list)

matche = dd(list)

for i in range(1, N + 1):
  e[i] = list(map(int, input().split()))

for i in range(1, N + 1):
  for j in range(N - 2):
    if matche[(min(e[i][j], i), max(e[i][j], i))] != []:
      matche[(min(e[i][j], i), max(e[i][j], i))].append((min(i, e[i][j + 1]), max(i, e[i][j + 1])))
    else:
      matche[(min(e[i][j], i), max(e[i][j], i))].append((min(i, e[i][j + 1]), max(i, e[i][j + 1])))
    #print(i, j, matche)
#print(matche)
matchkey = dc(matche)
S = matchkey.keys()
visited = dd(int)
depth = 0
#print(S)
def dfs(s):
  global visited
  global depth
  temp = 0
  #print(s)
  if matche[s] != []:
    for c in matche[s]:
      if visited[c] == 1:
        print(-1)
        #print(visited, c)
        exit(0)
      else:
        depth += 1
        visited[c] = 1
        #print(depth)
        temp = max(dfs(c), temp)
        depth -= 1
        visited[c] = 0
  else:
    return depth
  return temp
temp = 0
for s in S:
  temp = max(dfs(s), temp)
print(temp + 1)

### FIXED CODE ###

N = int(input())
A = []
for i in range(N):
  A.append(list(map(int, input().split())))
#試合にコードを割り当てる
#of[l] = 前の番号の競技者の「既に数え上げた試合の数」
#r = 相手
#l = じぶん
def code(l, r, of):
  if l > r:
      l, r = r, l
  return of[l] + r - l - 1
#オフセットを作る。重複の試合を取り除くため、
#1ならN - 1試合、2ならN - 2試合...という風にする
of = [0] * (N + 1)
for i in range(N):
  of[i + 1] = of[i] + N - i - 1
#print(of)
#試合の前後関係を持つグラフ
#たぶんDAGになっている。なってないなら試合組めないと思う
g = [[] for _ in range(N * (N - 1) // 2)]
for i in range(N):
  for j in range(N - 2):
      fcode = code(i, A[i][j] - 1, of)
      tcode = code(i, A[i][j + 1] - 1, of)
      g[fcode].append(tcode)
#print(g)
def sort_topologically(g):
  n = len(g)
  #ecはコードによる試合頂点の入次数を記録
  ec = [0] * n
  for i in range(n):
    for e in g[i]:
      ec[e] += 1
  #print(ec)
  #retは入次数0の頂点を順にとってきている
  ret = [0] * n
  q = 0
  for i in range(n):
    if ec[i] == 0:
      ret[q] = i
      q += 1
  #p = 参照中の入次数0の試合
  #q = 入次数0の頂点数
  #while文はp == qの時点で終わる
  #for文では、入次数0の頂点pから出る有向辺を除去する
  #その上で入次数0の頂点が増えればretへ追加
  #このretは確かにトポロジカル順序になる
  p = 0
  #print(ret)
  while p < q:
    for to in g[ret[p]]:
      ec[to] -= 1
      if ec[to] == 0:
        ret[q] = to
        q += 1
    p += 1
  #ソートが終わったなら全ての辺は除去済みのはずである
  #このグラフは一応連結しているはずなので閉路検知ができる
  for i in range(n):
    if ec[i] > 0:
      return None
  return ret

od = sort_topologically(g)
#print(od)
#Noneなら閉路を持つので試合構築不可能
if not od:
  print(-1)
else:
  #dp = トポロジカル順序を持つ順序集合の先頭からi番目までを見た際の最大パス長
  dp = [1] * (N * (N - 1) // 2)
  for i in range(N * (N - 1) // 2):
    for e in g[od[i]]:
      dp[e] = max(dp[e], dp[od[i]] + 1)
  #print(dp)
  print(max(dp))
### BUGGY CODE ###

def comb(n,r,m):
	if r == 0: return 1
	return memf[n]*pow(memf[r],m-2,m)*pow(memf[n-r],m-2,m)
def memfact(a):
	temp = 1
	yield temp
	for i in range(1,a+1):
		temp = temp * i % 1000000007
		yield temp

K = int(input())
S = input()
s = len(S)
ans = 0
m = 1000000007
memf = []
for x in memfact(s+K-1):
	memf.append(x)
for i in range(K+1):
	ans = (ans+comb(s+K-i-1,K-i,m)*pow(25,K-i,m)*pow(26,i,m)) % m
print(ans)

### FIXED CODE ###

def comb(n,r,m):
	if r == 0: return 1
	return memf[n]*pow(memf[r],m-2,m)*pow(memf[n-r],m-2,m)
def memfact(a):
	temp = 1
	yield temp
	for i in range(1,a+1):
		temp = temp * i % 1000000007
		yield temp

K = int(input())
S = input()
s = len(S)
ans = 0
m = 1000000007
memf = []
for x in memfact(s+K-1):
	memf.append(x)
for i in range(K+1):
	ans = (ans+comb(s+K-i-1,K-i,m)*pow(25,K-i,m)*pow(26,i,m)) % m
print(ans)
### BUGGY CODE ###

import numpy as np
N,Q=(int(i) for i in input().split())
x=input()
a=[]

j=0
s=[]
while (j<len(x)-1):
  if (x[j]=="A"):
    if (x[j+1]=="C"):
      s.append(1)
      s.append(0)
      j+=1
    else:s.append(0)
  else:s.append(0)
  j+=1
for i in range(0,Q):
  a.append([int(j) for j in input().split()])
  p=np.array(s[a[i][0]-1:a[i][1]-1])
  print(np.sum(p))





### FIXED CODE ###

N,Q=(int(i) for i in input().split())
x=input()
a=[]

j=0
s=[0]
t=0
while (j<N-1):
  if (x[j]=="A") and (x[j+1]=="C"):
    t+=1
    s.append(t)
  else:s.append(t)
  j+=1
for i in range(0,Q):
  a.append([int(j) for j in input().split()])
  p=s[a[i][1]-1]-s[a[i][0]-1]
  print(p)
### BUGGY CODE ###

n, t = map(int, input().split())
dp1 = [[-float("inf") for i in range(t)] for i in range(n + 1)]
dp1[0][0] = 0
dp2 = [[-float("inf") for i in range(t)] for i in range(n + 1)]
dp2[n][0] = 0
ab = []
for i in range(n):
    ab.append(list(map(int, input().split())))
for i in range(n):
    a, b = ab[i]
    for j in range(t - 1, -1, -1):
        if j >= a:
            dp1[i + 1][j] = max(dp1[i][j], dp1[i][j - a] + b)
        else:
            dp1[i + 1][j] = dp1[i][j]
for i in range(n - 1, -1, -1):
    a, b = ab[i]
    for j in range(t - 1, -1, -1):
        if j >= a:
            dp2[i][j] = max(dp2[i + 1][j], dp2[i + 1][j - a] + b)
        else:
            dp2[i][j] = dp2[i + 1][j]
ans = [max([max(dp1[i][:j + 1]) + max(dp2[i + 1][:t - j]) + ab[i][1]]) for j in range(t) for i in range(n)]
print(max(ans))

### FIXED CODE ###

n, t = map(int, input().split())
dp1 = [[-float("inf") for i in range(t)] for i in range(n + 1)]
dp1[0][0] = 0
dp2 = [[-float("inf") for i in range(t)] for i in range(n + 1)]
dp2[n][0] = 0
ab = []
for i in range(n):
    ab.append(list(map(int, input().split())))
for i in range(n):
    a, b = ab[i]
    for j in range(t - 1, -1, -1):
        if j >= a:
            dp1[i + 1][j] = max(dp1[i][j], dp1[i][j - a] + b)
        else:
            dp1[i + 1][j] = dp1[i][j]
for i in range(n + 1):
    for j in range(t - 1):
        dp1[i][j + 1] = max(dp1[i][j], dp1[i][j + 1])
for i in range(n - 1, -1, -1):
    a, b = ab[i]
    for j in range(t - 1, -1, -1):
        if j >= a:
            dp2[i][j] = max(dp2[i + 1][j], dp2[i + 1][j - a] + b)
        else:
            dp2[i][j] = dp2[i + 1][j]
for i in range(n + 1):
    for j in range(t - 1):
        dp2[i][j + 1] = max(dp2[i][j], dp2[i][j + 1])
ans = [max([dp1[i][j] + dp2[i + 1][t - 1 - j] + ab[i][1] for j in range(t)]) for i in range(n)]
print(max(ans))
### BUGGY CODE ###

MOD = 10**9 + 7

n = int(input())
a = list(map(int, input().split()))

ans = 0

for i in range(n-1):
    ans += a[i] * sum(a[i+1:])
    ans %= MOD

print(ans)


### FIXED CODE ###

MOD = 10**9 + 7

n = int(input())
a = list(map(int, input().split()))

s = sum(a)
ans = 0

for i in range(n-1):
    s -= a[i]
    ans += a[i] * s
    ans %= MOD

print(ans)
### BUGGY CODE ###

def main():
    n = int(input())
    A = list(map(int, input().split()))

    for i in range(n):
        a = A.pop()
        if a in A:
            print('NO')
            return
    print('YES')


if __name__ == '__main__':
    main()


### FIXED CODE ###

def main():
    n = int(input())
    A = list(map(int, input().split()))

    A_set = set(A)
    if len(A) == len(A_set):
        print('YES')
    else:
        print('NO')


if __name__ == '__main__':
    main()