Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
from itertools import accumulate
import math
import fractions

N = int(input())
A = [int(i) for i in input().split()]

#最大公約数で累積和作る
B = [0] * N
R = [0] * N
for i in range(N):
    B[i+1] = (fractions.gcd(B[i],A[i]))
    #逆向き,とったやつの反対端用   
    R[N-i -1] = (fractions.gcd(R[N-i], A[N-i -1]))
 
ans = 0
for i in range(N):
    ans = max(ans, fractions.gcd(B[i], R[i+1]))
print(ans)

Fixed submission:
from itertools import accumulate
import math
import fractions

N = int(input())
A = [int(i) for i in input().split()]

#最大公約数で累積和作る
B = [0] * (N+1)
R = [0] * (N+1)
for i in range(N):
    B[i+1] = (fractions.gcd(B[i],A[i]))
    #逆向き,とったやつの反対端用   
    R[N-i -1] = (fractions.gcd(R[N-i], A[N-1 -i]))
 
ans = 0
for i in range(N):
    ans = max(ans, fractions.gcd(B[i], R[i+1]))
print(ans)

Buggy python submission (verdict: Runtime Error):
from itertools import accumulate
import math
import fractions

N = int(input())
A = [int(i) for i in input().split()]

#最大公約数で累積和作る
B = [0] * N
R = [0] * N
for i in range(N):
    B[i+1] = (math.gcd(B[i],A[i]))
    #逆向き,とったやつの反対端用   
    R[N-i -1] = (math.gcd(R[N-i], A[N-i -1]))
 
ans = 0
for i in range(N):
    ans = max(ans, math.gcd(B[i], R[i+1]))
print(ans)


Fixed submission:
from itertools import accumulate
import math
import fractions

N = int(input())
A = [int(i) for i in input().split()]

#最大公約数で累積和作る
B = [0] * (N+1)
R = [0] * (N+1)
for i in range(N):
    B[i+1] = (fractions.gcd(B[i],A[i]))
    #逆向き,とったやつの反対端用   
    R[N-i -1] = (fractions.gcd(R[N-i], A[N-1 -i]))
 
ans = 0
for i in range(N):
    ans = max(ans, fractions.gcd(B[i], R[i+1]))
print(ans)

Buggy python submission (verdict: Runtime Error):
from itertools import accumulate
import math
import fractions

N = int(input())
A = [int(i) for i in input().split()]

#最大公約数で累積和作る
B = [0] * N
R = [0] * N
for i in range(N):
    B[i+1] = (math.gcd(B[i],A[i]))
    #逆向き,とったやつの反対端用   
    R[N-i -1] = (math.gcd(R[N-i], A[N-i -1]))
 
ans = 0
for i in range(N):
    ans = max(ans, math.gcd(B[i], R[i+1]))
print(ans)


Fixed submission:
from itertools import accumulate
import math
import fractions

N = int(input())
A = [int(i) for i in input().split()]

#最大公約数で累積和作る
B = [0] * (N+1)
R = [0] * (N+1)
for i in range(N):
    B[i+1] = (fractions.gcd(B[i],A[i]))
    #逆向き,とったやつの反対端用   
    R[N-i -1] = (fractions.gcd(R[N-i], A[N-1 -i]))
 
ans = 0
for i in range(N):
    ans = max(ans, fractions.gcd(B[i], R[i+1]))
print(ans)
Buggy python submission (verdict: Runtime Error):
from itertools import accumulate

N, Q = map(int, input().split())
S = input()
A = [list(map(int, input().split())) for i in range(Q)]
# リストに入れておく
#print(A)

flg = []
for i in range(N-1):
    tmp_S = S[i:i+2]
    if tmp_S == 'AC':
        flg.append(1)
    else:
        flg.append(0)
# print(len(flg)) #N-1になっていることを確認

ans = []
ans = [0] + flg #繋げて
ans = list(accumulate(flg)) #累積和にする
#print(ans)

for li in A:
    print(ans[li[1]-1] - ans[li[0]-1] )

Fixed submission:
from itertools import accumulate

N, Q = map(int, input().split())
S = input()
A = [list(map(int, input().split())) for i in range(Q)]
# リストに入れておく
#print(A)

flg = []
for i in range(N-1):
    tmp_S = S[i:i+2]
    if tmp_S == 'AC':
        flg.append(1)
    else:
        flg.append(0)
# print(len(flg)) #N-1になっていることを確認

ans = []
ans = [0] + flg #繋げて
ans = list(accumulate(ans)) #累積和にする
#print(ans)

for li in A:
    print(ans[li[1]-1] - ans[li[0]-1] )
Buggy python submission (verdict: Runtime Error):
X=int(input())
x=0
ans=[]

if X == 1:
  print(X)
else:
  # p
  for i in range(2, int(X**0.5)+1):
    n=1
    a=i
    # b
    while n < X : #超えたら中断
      n *= a
      ans.append(n)
    if n // a > x:
      x = (n//a)
      #print(ans)
print(max(i for i in ans if i <= X))

Fixed submission:
X=int(input())
x=0
ans=[]

if X == 1:
  print(X)
  exit()
else:
  # p
  for i in range(2, int(X**0.5)+1):
    n=1
    a=i
    # b
    while n < X : #超えたら中断
      n *= a
      ans.append(n)
    if n // a > x:
      x = (n//a)
      #print(ans)
print(max(i for i in ans if i <= X))
Buggy python submission (verdict: Runtime Error):
input1 = input()
input2 = input()

def match(x, y):
    i = 0
    if x is y:
        i = 1
    return i

result_list = map(match, input1, input2)
print(result_list.count(0))

Fixed submission:
input1 = input()
input2 = input()

def match(x, y):
    i = 0
    if x is y:
        i = 1
    return i

result_list = list(map(match, input1, input2))
print(result_list.count(0))
Buggy python submission (verdict: Runtime Error):
n, k = map(int, input().split())
pList = map(int, input().split())
list.sort(pList)
score = 0
for i in range(k):
    score += pList[i]
print(score)

Fixed submission:
n, k = map(int, input().split())
#pList = map(int, input().split())
split = input().split()
pList = [int(i) for i in split]
list.sort(pList)
score = 0
for i in range(k):
    score += pList[i]
print(score)

Buggy python submission (verdict: Runtime Error):
n, k = map(int, input().split())
pList = map(int, input().split())
#n, k = 5, 3
#pList = [50, 100, 80, 120, 80]
list.sort(pList)
score = 0
for i in range(k):
    score += pList[i]
print(score)

Fixed submission:
n, k = map(int, input().split())
#pList = map(int, input().split())
split = input().split()
pList = [int(i) for i in split]
list.sort(pList)
score = 0
for i in range(k):
    score += pList[i]
print(score)

Buggy python submission (verdict: Runtime Error):
n, k = map(int, input().split())
pList = map(int, input().split())
#n, k = 5, 3
#pList = [50, 100, 80, 120, 80]
list.sort(pList)
score = 0
for i in range(k):
    score += pList[i]
print(score)

Fixed submission:
n, k = map(int, input().split())
#pList = map(int, input().split())
split = input().split()
pList = [int(i) for i in split]
list.sort(pList)
score = 0
for i in range(k):
    score += pList[i]
print(score)
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
a=list(map(int,input().split()))
i=0
for i in range(len(a)):
    print(a.count(i+1))
    print('\n')
print(0)

Fixed submission:
n=int(input())
ans=[0]*n
a=list(map(int,input().split()))
for i in range(n-1):
    ans[a[i]-1]=ans[a[i]-1]+1
for i in ans:
    print(i)

Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
a=list(map(int,input().split()))
i=0
j=0
c=0
for i in range(len(a)):
    print(a.count(i+1))
    print('\n')
print(0)

Fixed submission:
n=int(input())
ans=[0]*n
a=list(map(int,input().split()))
for i in range(n-1):
    ans[a[i]-1]=ans[a[i]-1]+1
for i in ans:
    print(i)

Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
a=list(map(int,input().split()))
i=0
j=0
for i in range(len(a)):
    c=0
    for j in range(len(a)):
        if a[j]==i+1:
            c=c+1
    print(c)
    print('\n')
print(0)

Fixed submission:
n=int(input())
ans=[0]*n
a=list(map(int,input().split()))
for i in range(n-1):
    ans[a[i]-1]=ans[a[i]-1]+1
for i in ans:
    print(i)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
out = 1
an = list(map(int,input().split()))

for a in an:
  out *= a
if out>10**18:
  out=-1
print(out)

Fixed submission:
n = int(input())
out = 1
an = list(map(int,input().split()))
check = True
if 0 in an:
  print(0)
else:
  for a in an:
    out *= a
    if out>1000000000000000000:
      check = False
      break
  if check:
      print(out)
  else:
      print(-1)
Buggy python submission (verdict: Time Limit Exceeded):
import sys
import math
from collections import deque

N, M = list(map(int, input().split()))
H = list(map(int, input().split()))
AB = [list(map(int, input().split())) for _ in range(M)]

cnt = 0
for i in range(1,N+1):
    tmp = deque()
    for j in AB:
        if i in j:
            tmp.extend(j)
    tmp = list(set(tmp))
#    print(i,tmp)

    top_flag = True
    for k in tmp:
        if i == k:
            continue
        if H[i-1] <= H[k-1]:
            top_flag = False
    if top_flag == True:
        cnt += 1

print(cnt) 


Fixed submission:
import sys
import math
from collections import deque

N, M = list(map(int, input().split()))
H = list(map(int, input().split()))
AB = [list(map(int, input().split())) for _ in range(M)]

mydict = {}
for i in AB:
    if i[0] not in mydict:
        mydict[i[0]] =[i[1]]
    else:
        mydict[i[0]].append(i[1])

    if i[1] not in mydict:
        mydict[i[1]] =[i[0]]
    else:
        mydict[i[1]].append(i[0])


cnt = 0
for i in range(1,N+1):
    if i not in mydict.keys():
        cnt += 1
        continue

    top_flag = True
    for k in list(set(mydict[i])):
        if i == k:
            continue
        if H[i-1] <= H[k-1]:
            top_flag = False
            break
    if top_flag == True:
        cnt += 1

print(cnt)

Buggy python submission (verdict: Time Limit Exceeded):
import sys
import math

N, M = list(map(int, input().split()))
H = list(map(int, input().split()))
AB = [list(map(int, input().split())) for _ in range(M)]

cnt = 0
for i in range(1,N+1):
    tmp = []
    for j in AB:
        if i in j:
            tmp.extend(j)
    tmp = list(set(tmp))
#    print(i,tmp)

    top_flag = True
    for k in tmp:
        if i == k:
            continue
        if H[i-1] <= H[k-1]:
            top_flag = False
    if top_flag == True:
        cnt += 1

print(cnt) 


Fixed submission:
import sys
import math
from collections import deque

N, M = list(map(int, input().split()))
H = list(map(int, input().split()))
AB = [list(map(int, input().split())) for _ in range(M)]

mydict = {}
for i in AB:
    if i[0] not in mydict:
        mydict[i[0]] =[i[1]]
    else:
        mydict[i[0]].append(i[1])

    if i[1] not in mydict:
        mydict[i[1]] =[i[0]]
    else:
        mydict[i[1]].append(i[0])


cnt = 0
for i in range(1,N+1):
    if i not in mydict.keys():
        cnt += 1
        continue

    top_flag = True
    for k in list(set(mydict[i])):
        if i == k:
            continue
        if H[i-1] <= H[k-1]:
            top_flag = False
            break
    if top_flag == True:
        cnt += 1

print(cnt)
Buggy python submission (verdict: Time Limit Exceeded):
import sys
import itertools

N, M, Q = list(map(int, input().split()))
S = [list(map(int, input().split())) for _ in range(Q)]

max_value = 0
#for A in itertools.permutations(range(1, M+1), N):
for A in itertools.combinations_with_replacement(range(1, M+1), N):
    tmp_value = 0
    for i in range(len(S)):
        if S[i][1] > len(A) or S[i][0] > len(A):
            continue

        if A[S[i][1] - 1] - A[S[i][0] - 1] == S[i][2]:
            tmp_value += S[i][3]
#            print(A, A[S[i][1] - 1], A[S[i][0] - 1], S[i][2], S[i])
    if tmp_value > max_value:
        max_value = tmp_value
print(max_value)

Fixed submission:
import sys
import itertools

N, M, Q = list(map(int, input().split()))
S = [list(map(int, input().split())) for _ in range(Q)]

max_value = 0
#for A in itertools.permutations(range(1, M+1), N):
for A in itertools.combinations_with_replacement(range(1, M+1), N):
    tmp_value = 0
    for i in range(len(S)):
        if S[i][1] > len(A) or S[i][0] > len(A):
            continue

        if A[S[i][1] - 1] - A[S[i][0] - 1] == S[i][2]:
            tmp_value += S[i][3]
#            print(A, A[S[i][1] - 1], A[S[i][0] - 1], S[i][2], S[i])
    if tmp_value > max_value:
        max_value = tmp_value
print(max_value)
Buggy python submission (verdict: Time Limit Exceeded):
import sys

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

pre = N
while True:
    if N % K == 0 and N // K > 1:
        print(0)
        sys.exit()
        
    N = abs(N-K)
    if pre <= N:
        print(pre)
        sys.exit()
    else:
        pre = N

Fixed submission:
import sys

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

pre = N
while True:
    if N % K == 0 and N // K >= 1:
        print(0)
        sys.exit()
        
    if N > K:
        N = N % K
    else:
        N = abs(N-K)
    
    if pre <= N:
        print(pre)
        sys.exit()
    else:
        pre = N
Buggy python submission (verdict: Runtime Error):
    import sys
    S = str(input())
    Q = int(input())
    Query = [list(map(str, input().split())) for _ in range(Q)]
     
    sArry = S.split()
    for i in range(Q):
    #    print(i,Query[i])
        if Query[i][0] == '1':
            tmp_first = sArry[0]
            sArry[0] = sArry[-1]
            sArry[-1] = tmp_first
        else:
            if Query[i][1] == '1':
                sArry.insert(0, Query[i][2])
            else:
                sArry.append(Query[i][2])
                
    print("".join(sArry))



Fixed submission:
from collections import deque

S = str(input())
Q = int(input())
Query = [list(map(str, input().split())) for _ in range(Q)]

sArry = deque(S)
rFlag = False
for i in range(Q):
    if Query[i][0] == '1':
        rFlag = (rFlag == False)
        
    else:
        if rFlag:
            if Query[i][1] == '1':
                sArry.append(Query[i][2])
            else:
                sArry.appendleft(Query[i][2])
        else:
            if Query[i][1] == '1':
                sArry.appendleft(Query[i][2])
            else:
                sArry.append(Query[i][2])
            
#    print("  ", i, rFlag, "".join(sArry), Query[i])



if rFlag:
    print("".join(reversed(sArry)))
else:
    print("".join(sArry))
Buggy python submission (verdict: Runtime Error):
10000 1

Fixed submission:
import math
(H, A) = list(map(int, input().split()))

print(math.ceil(H / A))
Buggy python submission (verdict: Time Limit Exceeded):
(N, K) = list(map(int, input().split()))
H = list(map(int, input().split()))

H = sorted(H, reverse=True)
while (K > 0) and (len(H) > 0):
    H.pop(0)
    K -= 1
print(sum(H))

Fixed submission:
(N, K) = list(map(int, input().split()))
H = list(map(int, input().split()))

H = sorted(H, reverse=True)
if K >= len(H):
    print(0)
else:
    del H[0:K]
    print(sum(H))
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
P = list(map(int, input().split()))

ok_count = 0
for i in range(N):
    ok_flag = True
    for j in range(i):
        if P[i] > P[j]:
            ok_flag = False
            break
    
    if ok_flag:
        ok_count += 1

print(ok_count)


Fixed submission:
N = int(input())
P = list(map(int, input().split()))

NG_count = 0
min = P[0]
for i in range(N):
    if min >= P[i]:
        min = P[i]
    elif min < P[i]:
        NG_count += 1

print(N - NG_count)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
P = list(map(int, input().split()))

ok_count = 0
for i in range(N):
    ok_flag = True
    for j in range(i):
        if P[i] > P[j]:
            ok_flag = False
        else:
            continue
    
    if ok_flag:
        ok_count += 1

print(ok_count)


Fixed submission:
N = int(input())
P = list(map(int, input().split()))

NG_count = 0
min = P[0]
for i in range(N):
    if min >= P[i]:
        min = P[i]
    elif min < P[i]:
        NG_count += 1

print(N - NG_count)
Buggy python submission (verdict: Runtime Error):
from fractions import math
(A, B) = list(map(int, input().split()))
print((A * B) // gcd(A, B))

Fixed submission:
import fractions
(A, B) = list(map(int, input().split()))
print((A * B) // fractions.gcd(A, B))

Buggy python submission (verdict: Runtime Error):
import math
(A, B) = list(map(int, input().split()))
print((A * B) // math.gcd(A, B))

Fixed submission:
import fractions
(A, B) = list(map(int, input().split()))
print((A * B) // fractions.gcd(A, B))
Buggy python submission (verdict: Runtime Error):
from operator import itemgetter

N_shop, M_required_drink  = map(int, raw_input().split())

shop_list = []
for tmp_shop in range(N_shop):
  shop_list.append(map(int, raw_input().split()))

total_money = 0
got_drink = 0
for i in sorted(shop_list, key=itemgetter(0)):
  limit_at_shop = i[1]
#  print(i)

  while got_drink < M_required_drink and limit_at_shop > 0:
    total_money = total_money + i[0]
    got_drink   = got_drink + 1
    limit_at_shop = limit_at_shop - 1
#    print("  %s %s %s" % (total_money, got_drink, limit_at_shop))

print(total_money)


Fixed submission:
first_args = raw_input().split()
second_args = raw_input().split()

max_row = int(first_args[0])
max_col = int(first_args[1])

fill_row = int(second_args[0])
fill_col = int(second_args[1])

if(fill_row <= max_row and fill_col <= max_col):
  all_cells = max_row * max_col
  filled_cells = (fill_row * max_col) + (fill_col * max_row) - (fill_row * fill_col)

  print all_cells - filled_cells

Buggy python submission (verdict: Runtime Error):
from operator import itemgetter

N_shop, M_required_drink  = map(int, raw_input().split())

shop_list = []
for tmp_shop in range(N_shop):
  shop_list.append(map(int, raw_input().split()))

total_money = 0
got_drink = 0
for i in sorted(shop_list, key=itemgetter(0)):
  limit_at_shop = i[1]
#  print(i)

  while got_drink < M_required_drink and limit_at_shop > 0:
    total_money = total_money + i[0]
    got_drink   = got_drink + 1
    limit_at_shop = limit_at_shop - 1
#    print("  %s %s %s" % (total_money, got_drink, limit_at_shop))

print(total_money)


Fixed submission:
first_args = raw_input().split()
second_args = raw_input().split()

max_row = int(first_args[0])
max_col = int(first_args[1])

fill_row = int(second_args[0])
fill_col = int(second_args[1])

if(fill_row <= max_row and fill_col <= max_col):
  all_cells = max_row * max_col
  filled_cells = (fill_row * max_col) + (fill_col * max_row) - (fill_row * fill_col)

  print all_cells - filled_cells
Buggy python submission (verdict: Time Limit Exceeded):
import re
  
bit_string = raw_input()

replaced_count = 0
replaced_string = bit_string
while re.search('01|10', replaced_string):
  replaced_string, tmp_count = re.subn('01|10', '', replaced_string)
  replaced_count += tmp_count
print(replaced_count * 2)

Fixed submission:
bit_string = raw_input()
  
count_zero = bit_string.count('0')
count_one  = bit_string.count('1')
print((min(count_zero, count_one) * 2))
Buggy python submission (verdict: Runtime Error):
import sys

num_exam = int(raw_input())
current_scores    = map(int, raw_input().split())
exam_boarderlines = map(int, raw_input().split())

margin_scores = []
lack_scores   = []
count_adjusted = 0

if sum(current_scores) < sum(exam_boarderlines):
  print(-1)
  sys.exit()

for i in range(num_exam):
  if current_scores[i] < exam_boarderlines[i]:
    lack_scores.append(current_scores[i] - exam_boarderlines[i])
    count_adjusted += 1
  elif current_scores[i] > exam_boarderlines[i]:
    margin_scores.append(current_scores[i] - exam_boarderlines[i])

desc_sorted_margin_scores = sorted(margin_scores, reverse=True)
total_lack_score = sum(lack_scores)
for i in range(len(desc_sorted_margin_scores)):
  if total_lack_score >= 0:
    break

  total_lack_score += desc_sorted_margin_scores[i]
  count_adjusted += 1

print(count_adjusted)
~                     

Fixed submission:
import sys

num_exam = int(raw_input())
current_scores    = map(int, raw_input().split())
exam_boarderlines = map(int, raw_input().split())

margin_scores = []
lack_scores   = []
count_adjusted = 0

if sum(current_scores) < sum(exam_boarderlines):
  print(-1)
  sys.exit()

for i in range(num_exam):
  if current_scores[i] < exam_boarderlines[i]:
    lack_scores.append(current_scores[i] - exam_boarderlines[i])
    count_adjusted += 1
  elif current_scores[i] > exam_boarderlines[i]:
    margin_scores.append(current_scores[i] - exam_boarderlines[i])

desc_sorted_margin_scores = sorted(margin_scores, reverse=True)
total_lack_score = sum(lack_scores)
for i in range(len(desc_sorted_margin_scores)):
  if total_lack_score >= 0:
    break

  total_lack_score += desc_sorted_margin_scores[i]
  count_adjusted += 1

print(count_adjusted)
Buggy python submission (verdict: Runtime Error):
from collections import Counter
N = (int)(input())
A = [input() for i in range(N)]

B = Counter(A)


max = [kv for kv in B.items() if kv[1] == max(B.values())]

for i in reversed(max):
    print(i[0])

Fixed submission:
l = list(map(int, input().split()))
A = l[0]
B = l[1]
C = l[2]

if(A == B):
    if(A != C):
        print("Yes")
    else:
        print("No")
else:
    if(A != C):
        if(B == C):
            print("Yes")
        else: print("No")
    else:
        print("Yes")
Buggy python submission (verdict: Time Limit Exceeded):
N = (int)(input())
A = list(map(int, input().split()))

def hash(a):
    return a%100


def check(A):
    for i in range(len(A)):
        for j in range(i, len(A)):
            if(j+1 < len(A)):
                if(A[i] == A[j+1]):
                    # print("%d=%d"%(A[i], A[j]))
                    flag = True
                    return 'NO'

    return 'YES'

arr = [[] for i in range(100)]

for i in A:
    arr[hash(i)].append(i)

for i in arr:
    flag = False
    if(check(i) == "NO"):
        print("NO")
        flag = True
        break
if(not flag):
    print("YES")

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

A.sort()
# print(A)
flag = False
for i in range(len(A)):
    if(i+1 < len(A)):
        if(A[i] == A[i+1]):
            print("NO")
            flag = True
            break
if(not flag):
    print("YES")

Buggy python submission (verdict: Time Limit Exceeded):
N = (int)(input())
A = list(map(int, input().split()))

def hash(a):
    return a%10


def check(A):
    for i in range(len(A)):
        for j in range(i, len(A)):
            if(j+1 < len(A)):
                if(A[i] == A[j+1]):
                    # print("%d=%d"%(A[i], A[j]))
                    flag = True
                    return 'NO'

    return 'YES'

arr = [[] for i in range(10)]

for i in A:
    arr[hash(i)].append(i)

for i in arr:
    flag = False
    if(check(i) == "NO"):
        print("NO")
        flag = True
        break
if(not flag):
    print("YES")

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

A.sort()
# print(A)
flag = False
for i in range(len(A)):
    if(i+1 < len(A)):
        if(A[i] == A[i+1]):
            print("NO")
            flag = True
            break
if(not flag):
    print("YES")

Buggy python submission (verdict: Time Limit Exceeded):
N = (int)(input())
A = list(map(int, input().split()))

flag = False
for i in range(len(A)):
    for j in range(i, len(A)):
        if(j+1 < len(A)):
            if(A[i] == A[j+1]):
                #print("%d=%d"%(A[i], A[j]))
                print("NO")
                flag = True
                break
    if flag:
        break

if not flag:
    print("YES")

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

A.sort()
# print(A)
flag = False
for i in range(len(A)):
    if(i+1 < len(A)):
        if(A[i] == A[i+1]):
            print("NO")
            flag = True
            break
if(not flag):
    print("YES")