Harryxun/stf_run huggingface dataset:
n, m = map(int, input().split())
if m == 1 and n == 1:
    S =0
else:
    l = sorted(list(map(int, input().split())), reverse=True)
    d = sorted([l[i] - l[i+1]  for i in range(m-1)], reverse=True)
    S = max(l) - min(l)

    for i in range(n-1):
        S -= d[i]

print(S)

### FIXED CODE ###

n, m = map(int, input().split())
l = sorted(list(map(int, input().split())), reverse=True)

if n>=m or m == 1:
    S =0
else:
    d = sorted([l[i] - l[i+1]  for i in range(m-1)], reverse=True)
    S = max(l) - min(l)
    for i in range(n-1):
        S -= d[i]

print(S)
def gcd(a, b):
  if b==0:
    return a
  return gcd(b, a%b)

int main():
  a,b = map(int, input().split())
  g = gcd(a,b)
  N = int(g*0.5)
  ans = 1
  for i in range(2, N+1):
    flag = 0
    while(g%i==0):
      g /= i
      flag = 1
    ans += flag
  if g != 1:
    ans += 1
  print(ans)

main()

### FIXED CODE ###

def gcd(a, b):
  if b==0:
    return a
  return gcd(b, a%b)

a,b = map(int, input().split())
g = gcd(a,b)
N = int(g**0.5)
ans = 1
for i in range(2, N+1):
  if g%i==0:
    ans += 1
  while(g%i==0):
    g /= i
if g != 1:
  ans += 1
print(ans)
n,x,=map(int, input().split())
w = list(map(int, input().split()))

d=0
if(x==1):
print(0)
else:
    for i in range(n):
        d=d+w[i]
        if(d>x):
            break
        if(d>=10000):
            break
   
    print(i+1)

### FIXED CODE ###

n,x = map(int,input().split())
li = list(map(int,input().split()))
 
ans = 1
now = 0
 
for i in li:
    now += i
    if now <= x:
        ans += 1
    else:
        break
 
print(ans)
N, K = tuple(map(int, input().split()))
S = "1"+input()+"1"

prev = S[0]
if prev == "0":
  fst_is_0 = True
else:
  fst_is_0 = False

cnt = 0
cnt_0 = 0

cnt_lst = []
for idx, s in enumerate(S):
  if s == prev:
    cnt += 1
  else:
    cnt_lst.append(cnt)
    if s == "0":
      cnt_0 += 1
    prev = s
else:
  cnt_lst.append(cnt)
#print(cnt_lst)


if cnt_0 <= K:
  print(len(S)-2)
else:
  l = [cnt_lst[2*idx+2*K+1] -cnt_lst[idx*2] for idx in range( int( (len(cnt_lst)+1)/2) -K)   ]
  #print(l)
  ss = []
  for idx,sss in enumerate(l):
    if idx == 0:
      ss.append(sss-1)
    elif idx == len(l)-1:
      
      ss.append(sss-1)
    else:
      ss.append(sss)
      
  print(max(ss))

### FIXED CODE ###

N, K = tuple(map(int, input().split()))
S = "1"+input()+"1"

prev = S[0]
if prev == "0":
  fst_is_0 = True
else:
  fst_is_0 = False

cnt = 0
cnt_0 = 0

cnt_lst = []
for idx, s in enumerate(S):
  if s == prev:
    cnt += 1
  else:
    cnt_lst.append(cnt)
    cnt = 1
    if s == "0":
      cnt_0 += 1
    prev = s
else:
  cnt_lst.append(cnt)
#print(cnt_lst)


if cnt_0 <= K:
  print(len(S)-2)
else:
  prev = "1"
  cnt_lst = [0]
  for idx,s in enumerate(S):
    if prev != s:
      cnt_lst.append(idx)
    prev=s
  cnt_lst.append(len(S))
  s_ =[]
  for idx in range( int( (len(cnt_lst)+1)/2) -K):
    #print(2*idx+2*K,idx*2,cnt_lst[2*idx+2*K+1] -cnt_lst[idx*2])
    if idx==0 or idx==int( (len(cnt_lst)+1)/2) -K-1:
      s_.append(cnt_lst[2*idx+2*K+1] -cnt_lst[idx*2]-1)
    else:
      s_.append(cnt_lst[2*idx+2*K+1] -cnt_lst[idx*2])
  print(max(s_))
h, n = map(int, input().split())
ab = [list(map(int, input().split())) for _ in range(n)]
max_a = min(a for a, _ in ab)
dp = [10 ** 18 for _ in range(h + max_a)]
dp[0] = 0
for i in range(1, h + max_a):
    dp[i] = min(dp[i-a] + b for a, b in ab)
print(min(dp[h:]))


### FIXED CODE ###

inf = 10 ** 18
h, n = map(int, input().split())
ab = [list(map(int, input().split())) for _ in range(n)]
max_a = max(a for a, _ in ab)
dp = [inf] * (h + max_a)
dp[0] = 0
for i in range(1, h + max_a):
    dp[i] = min(dp[i-a] + b for a, b in ab)
print(min(dp[h:]))
# coding: utf-8
import sys
#from operator import itemgetter
sysread = sys.stdin.buffer.readline
read = sys.stdin.buffer.read
#from heapq import heappop, heappush
from collections import defaultdict
sys.setrecursionlimit(10**7)
#import math
#from itertools import product, accumulate, combinations, product
import bisect
#import numpy as np
#from copy import deepcopy
#from collections import deque
#from decimal import Decimal
#from numba import jit

INF = 1 << 50
EPS = 1e-8
mod = 10 ** 9 + 7


def run():
    N = int(sysread())
    A = list(map(int, sysread().split()))
    B = list(map(int, sysread().split()))
    C = list(map(int, sysread().split()))
    A.sort()
    B.sort()
    C.sort()
    ansBa = []
    ansBc = []
    for i in range(N):
        b = B[i]
        idx = bisect.bisect_left(A, b)
        ansBa.append(idx)

        idx2 = bisect.bisect_left(C, b)
        ansBc.append(N-idx2)
        if b == C[idx2]:
            ansBc[-1] -= 1
    #print(ansBc, ansBa)
    ans = 0
    for aa, cc in zip(ansBa, ansBc):
        ans += aa * cc


    print(ans)

if __name__ == "__main__":
    run()


### FIXED CODE ###

# coding: utf-8
import sys
#from operator import itemgetter
sysread = sys.stdin.buffer.readline
read = sys.stdin.buffer.read
#from heapq import heappop, heappush
from collections import defaultdict
sys.setrecursionlimit(10**7)
#import math
#from itertools import product, accumulate, combinations, product
import bisect
#import numpy as np
#from copy import deepcopy
#from collections import deque
#from decimal import Decimal
#from numba import jit

INF = 1 << 50
EPS = 1e-8
mod = 10 ** 9 + 7


def run():
    N = int(sysread())
    A = list(map(int, sysread().split()))
    B = list(map(int, sysread().split()))
    C = list(map(int, sysread().split()))
    A.sort()
    B.sort()
    C.sort()
    ansBa = []
    ansBc = []
    for i in range(N):
        b = B[i]
        idx = bisect.bisect_left(A, b)
        ansBa.append(idx)

        idx2 = bisect.bisect_right(C, b)
        ansBc.append(N-idx2)

    #print(ansBc, ansBa)
    ans = 0
    for aa, cc in zip(ansBa, ansBc):
        ans += aa * cc


    print(ans)

if __name__ == "__main__":
    run()
## tasks https://atcoder.jp/contests/dp/tasks
## TODO

def solution():
    # result array for calculation for optimal cost for every stone
    res = [[-1 for x in range(3)] for y in range(n)]
    res[0] = a[0]
    for i in range(1,n):
        # going through the all days
        for j in range(3):
            # calucaltion for every possible actions, but skipping the same activity
            # picked current activity is j, let us get options from non j and get max of them
            # it will be a cost for j
            # do it for every

            #searching for best previous happines
            bph = -1
            for o in range(3):
                #skipping the same activity
                if o==j:
                    continue
                bph = max(bph, res[i-1][o])
            #print("res = {} a = {}".format(res, a))
            #print("i={} j={}".format(i, j))
            res[i][j] = max(res[i][j], bph + a[i][j])

    return max(res[-1][0],res[-1][1],res[-1][2])


if __name__ == "__main__":
    n = int(input())

    a = [[None for x in range(3)] for y in range(n)]

    for i in range(n):
        row = list(map(int, raw_input().split(" ")))
        for j in range(3):
            a[i][j] = row[j]

    #print("n = {} a = {}".format(n, a))
    if n == 1:
        print max(a[0][0],a[0][1],a[0][2])
    else:
        print(solution())


### FIXED CODE ###

## tasks https://atcoder.jp/contests/dp/tasks
## TODO

def solution():
    # result array for calculation for optimal cost for every stone
    res = [[-1 for x in range(3)] for y in range(n)]
    res[0] = a[0]
    for i in range(1,n):
        # going through the all days
        for j in range(3):
            # calucaltion for every possible actions, but skipping the same activity
            # picked current activity is j, let us get options from non j and get max of them
            # it will be a cost for j
            # do it for every

            #searching for best previous happines
            bph = -1
            for o in range(3):
                #skipping the same activity
                if o==j:
                    continue
                bph = max(bph, res[i-1][o])
            #print("res = {} a = {}".format(res, a))
            #print("i={} j={}".format(i, j))
            res[i][j] = max(res[i][j], bph + a[i][j])

    return max(res[-1][0],res[-1][1],res[-1][2])


if __name__ == "__main__":
    n = int(input())

    a = [[None for x in range(3)] for y in range(n)]

    for i in range(n):
        row = list(map(int, input().split(" ")))
        for j in range(3):
            a[i][j] = row[j]

    #print("n = {} a = {}".format(n, a))
    if n == 1:
        print(max(a[0][0],a[0][1],a[0][2]))
    else:
        print(solution())
A = int(input())
B = int(input())

C=A*B
if A <= 9 and B <= 9:
	print(C)
else:
	print(-1)

### FIXED CODE ###

def main(a, b):
    if a>9:
        return -1
    if b>9:
        return -1
        
    return a*b

inp = input().split();
a = int(inp[0])
b = int(inp[1])
print(main(a,b))
c = input()
print("vowel" if c = "a" or c = "i" or c = "u" or c = "e" or c = "o" else "consonant")

### FIXED CODE ###

c = input()
print("vowel" if c == "a" or c == "i" or c == "u" or c == "e" or c == "o" else "consonant")
k,a,b = map(int,input().split())
if b-a <= 2:
  print(k+1)
elif  a+1 >= k:
  print(k+1)
else:
  print(a+int((k+1-a)/2)*max(2,(b-a))+(k+1-a)%2)

### FIXED CODE ###

n,k = map(int,input().split())
m = int(n/2)+n%2
ans = 'YES' if m>=k else 'NO'
print(ans)
n, k = map(int, input().split())
s = list(input())

cnt = []
if s[0] == '0': cnt.append(0)

i = 0
while i < n:
    j = i
    while j < n and s[j] == s[i]:
        j += 1
    cnt.append(j- i)
    i = j
if s[-1] == '0': cnt.append(0)

cs = [0] * (len(cnt)+1)
for i in range(len(cnt)):
    cs[i+1] = cs[i] + cnt[i]

ans = 0
m = 2 * k + 1
for i in range(0, len(cnt), 2):
    ans = max(ans, cs[i+m] - cs[i])

print(ans)


### FIXED CODE ###

n, k = map(int, input().split())
s = list(input())

cnt = []
if s[0] == '0': cnt.append(0)
i = 0
while i < n:
    j = i
    while j < n and s[j] == s[i]:
        j += 1
    cnt.append(j- i)
    i = j
if s[-1] == '0': cnt.append(0)

m = len(cnt)
cs = [0] * (m+1)
for i in range(m):
    cs[i+1] = cs[i] + cnt[i]

ans = 0
for l in range(0, m+1, 2):
    r = l + 2 * k + 1
    if r > m: r = m
    ans = max(ans, cs[r] - cs[l])

print(ans)
N = input()
for i in range(N):
    if N[i] = '7':
        print('Yes')
        break
else:
    print('No')

### FIXED CODE ###

N = input()
for i in range(len(N)):
    if N[i] == '7':
        print('Yes')
        break
else:
    print('No')
"""
奇数本の辺で成り立つ閉路があれば、全ての頂点同士を1本の辺で結ぶことができる。
そうでない場合は、奇数本の辺をたどってたどり着ける頂点同士は全て1本の辺で結ぶことができる。
奇数本の閉路があるかどうかを、どうやって判定するか？
二部グラフ判定を行う。
二部グラフ判定ってどうやるんだっけ？→となりのノードに違う色をつけていって、矛盾がなければ二部グラフ。矛盾があれば二部グラフじゃない。
"""
def judgeBiGragh(edges):
    n = len(edges)
    colors = [-1]*(n+1)
    def paint(v,c):
        if colors[v] == -1:
            colors[v] = c
            nxC = (c+1)%2
            for nxV in edges[v]:
                result = paint(nxV,nxC)
                if result == False:
                    return result
        else:
            if colors[v] != c:
                return False
        return True
    return paint(1,0)

N,M = map(int,input().split())
edges = [[] for _ in range(N+1)]
for _ in range(M):
    a,b = map(int,input().split())
    edges[a].append(b)
    edges[b].append(a)
def choose(n,k):
    import math
    return math.factorial(n)//(math.factorial(n-k)*math.factorial(k))
if judgeBiGragh(edges):
    ans = (N//2)*(N-N//2) - M
else:
    ans = choose(N,2)-M

print(ans)

### FIXED CODE ###

"""
グラフが二部グラフかどうかを判定する。
二部グラフであれば、AグループのノードとBグループのノード同士をそれぞれ結ぶことができる。
二部グラフでない場合、すべてのノード同士を結ぶことができる。
"""
import math
from collections import Counter
import sys
sys.setrecursionlimit(200000)
def choose(n):
    return math.factorial(n)//(math.factorial(n-2)*math.factorial(2))
N,M = map(int,input().split())
edges = [[]for _ in range(N+1)]
for _ in range(M):
    A,B = map(int,input().split())
    edges[A].append(B)
    edges[B].append(A)

colors = [-1]*(N+1)
def f(n,p):
    c = colors[n]
    for v in edges[n]:
        if v != p:
            if colors[v] == -1:
                colors[v] = 1 if c==0 else 0
                f(v,n)
            elif colors[v] == c:
                print(choose(N)-M)
                exit()
colors[1]=0
f(1,0)
count1 = colors.count(0)
count2 = colors.count(1)
print(count1*count2-M)
from functools import lru_cache

n, m = map(int, input().split())
a = set(int(input()) for _ in range(m))

mod = 10**9+7

@lru_cache(maxsize=n)
def stairway(i) :
    if i in a :
        return 0
    elif i == 0 :
        return 1
    elif i == 1 :
        return stairway(0)
    else :
        return (stairway(i-1)+stairway(i-2))%mod
    
print(stairway(n))

### FIXED CODE ###

from functools import lru_cache
from sys import setrecursionlimit

n, m = map(int, input().split())
a = set(int(input()) for _ in range(m))

mod = 10**9+7
setrecursionlimit(mod)

@lru_cache(maxsize=n)
def stairway(i) :
    if i in a :
        return 0
    elif i == 0 :
        return 1
    elif i == 1 :
        return stairway(0)
    else :
        return (stairway(i-1)+stairway(i-2))%mod
    
print(stairway(n))
N, M = map(int,input().split())
data = []
for i in range(M):
    data.append(int(input()))
bef = 0
for i in data:
    if bef + 1 == i:
        print(0)
        exit()
    bef = i
print(int(2 ** ((N - M * 2) / 2)) % 1000000007)

### FIXED CODE ###

N, M = map(int,input().split())
data = []
dp = ['.' for i in range(N + 1)]
dp[0] = 1
dp[1] = 1
for i in range(M):
    k = int(input())
    data.append(k)
    dp[k] = 0
mod = 10**9 + 7
for i in range(2,N + 1):
    if dp[i] != 0:
        dp[i] = (dp[i - 1] + dp[i - 2]) % mod
print(dp[N] % mod)
import math

N = input()
xs = [int(i) for i in input().split()]
p = round(sum(xs)/len(xs))

print(sum(math.pow(x-p) for x in xs))

### FIXED CODE ###

import math

N = input()
xs = [int(i) for i in input().split()]
p = round(sum(xs)/len(xs))

print(int(sum(math.pow(x-p, 2) for x in xs)))
# -*- coding: utf-8 -*-

n = int(input())
xy = [list(map(int, input().split())) for i in range(n)]

xy.sort()
xy = xy[::-1]

import itertools

# itertools.permutations(xy, 2)

aaa = []
for i in list(itertools.combinations(xy, 2)):
    a, b, c, d = sum(i, [])
    aaa.append([str(a-c)+str(b-d)])
    # print(a,b,c,d)
# print(aaa)
aaa = sum(aaa, [])
import collections
bbb = collections.Counter(aaa)
# print(bbb.most_common())
print(n-bbb.most_common()[0][1])



### FIXED CODE ###

# -*- coding: utf-8 -*-

n = int(input())
xy = [list(map(int, input().split())) for i in range(n)]
if len(xy) == 1:
    print(1)
    exit()

xy.sort()
xy = xy[::-1]
aaa = []
for i in range(len(xy)-1):
    for j in range(i+1, len(xy)):
        a, b = xy[i]
        c, d = xy[j]
        aaa.append(str(a-c)+str(b-d))

# import itertools
#
# # itertools.permutations(xy, 2)
#
# aaa = []
# for i in list(itertools.combinations(xy, 2)):
#     a, b, c, d = sum(i, [])
#     aaa.append([str(a-c)+str(b-d)])
#     # print(a,b,c,d)
# # print(aaa)
# aaa = sum(aaa, [])
# print(aaa)
import collections
bbb = collections.Counter(aaa)
# print(bbb.most_common())
print(n-bbb.most_common()[0][1])
N = int(input())
A = list(map(int, input().split()))

import numpy as np
sumA = np.cumsum(A)

ans = float('inf')
for i in range(0, N-1):
    x = sumA[i]
    y = sumA[-1] - x
    ans = min(abs(x-y), ans)
print(ans)

### FIXED CODE ###

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

import numpy as np
sumA = np.cumsum(A)

ans = float('inf')
for i in range(0, N-1):
    x = sumA[i]
    y = sumA[-1] - x
    ans = min(abs(x-y), ans)
print(ans)
N = int(input())
l = len(str(N))
ans = 0

if l%2 == 0:
    for i in range(0, l, 2):
        ans += 9*(10**i)
else:
    for i in range(0,l-2, 2):
        ans += 9*(10**i)
        #print(ans)
    ans += N - int('9'*(len(str(N))-1))

print(ans)
#print(l)

### FIXED CODE ###

N = int(input())
l = len(str(N))
ans = 0

if l != 1:
    if l%2 == 0:
        for i in range(0, l, 2):
            ans += 9*(10**i)
    else:
        for i in range(0,l-2, 2):
            ans += 9*(10**i)
            #print(ans)
        ans += N - int('9'*(len(str(N))-1))
else:
    ans = N

print(ans)
#print(l)
N = int(input())
li = [[int(x) for x in input().split()] for _ in range(N)]
map = [[-1 for _ in range(101)] for _ in range(101)]
ans = [0]*3
for i in range(101):
    for j in range(101):
        h = -1
        flag = True
        for x in li:
            if(h == -1):
                h=x[2]+abs(x[0]-i)+abs(x[1]-j)
            else:
                if(h!=x[2]+abs(x[0]-i)+abs(x[1]-j)):
                    flag = False
        if(flag):
            ans=[str(i),str(j),str(h)]
            break
print(ans[0]+' '+ans[1]+' '+ans[2])


### FIXED CODE ###

import sys
from operator import itemgetter
sys.setrecursionlimit(10**7)
N = int(input())
li = [[int(x) for x in input().split()] for _ in range(N)]
li.sort(key=itemgetter(2),reverse=True)
map = [[-1 for _ in range(101)] for _ in range(101)]
ans = [0]*3
for i in range(101):
    for j in range(101):
        h = -1
        flag = True
        for x in li:
            if(h == -1):
                h=x[2]+abs(x[0]-i)+abs(x[1]-j)
            else:
                if(x[2]!=0):
                    if(h!=x[2]+abs(x[0]-i)+abs(x[1]-j)):
                        flag = False
                else:
                    if(h>abs(x[0]-i)+abs(x[1]-j)):
                        flag = False
        if(flag):
            if(h>ans[2]):
                ans=[i,j,h]

print(str(ans[0])+' '+str(ans[1])+' '+str(ans[2]))
r = int(input())
l = math.pi * 2 * r
print(l)

### FIXED CODE ###

import math
r = int(input())
l = math.pi * 2 * r
print(l)
#!/usr/bin/env python3
import sys
import functools
from math import factorial

MOD = 10**9 + 7  # type: int

def solve(N: int, K: int):
    def C(n: int, r: int):
        return factorial(n) // factorial(r) // factorial(n - r)

    for i in range(1, K+1):
        a = C(N-K+1, i)
        b = C(K-1, i-1)
        print((a*b) % MOD)
    return


# Generated by 1.1.4 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    K = int(next(tokens))  # type: int
    solve(N, K)

if __name__ == '__main__':
    main()


### FIXED CODE ###

#!/usr/bin/env python3
import sys
import functools
from math import factorial
from operator import mul

MOD = 10**9 + 7  # type: int

def solve(N: int, K: int):
    facts = [1] * (N+1)
    for i in range(2, N+1):
        facts[i] = facts[i-1] * (i)

    def C(n: int, r: int):
        upper = facts[n]
        lower = facts[r] * facts[n-r]
        return (upper // lower) % MOD

    for i in range(1, K+1):
        a = C(N-K+1, i)
        b = C(K-1, i-1)
        print((a*b) % MOD)
    return


# Generated by 1.1.4 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    K = int(next(tokens))  # type: int
    solve(N, K)

if __name__ == '__main__':
    main()
n = input()
value = n[-3]+n[-2]+n[-1]
#print(value)
value_int = int(value)
if value == '000':
    print(0)
else:
    print(1000 - value_int)

### FIXED CODE ###

n = input()
if len(n) < 3:
    print(1000- int(n))
else:   
    value = n[-3]+n[-2]+n[-1]
    #print(value)
    value_int = int(value)
    if value == '000':
        print(0)
    else:
        print(1000 - value_int)
import math
import numpy as np
def lcm(x, y):
    return (x * y) // math.gcd(x, y)

A, B, C, D = list(map(int,input().split(' ')))

arr = np.arange(A,B+1,1)

a1 = A // C
a2 = A // D

b1 = B // C
b2 = B // D 

ab1 = b1 - a1
ab2 = b2 - a2

if A % C  == 0 and B % C == 0:
    ab1 += 1
if A % D  == 0 and B % D == 0:
    ab2 += 1
lc = lcm(C,D)
a3 = A // lc
b3 = B // lc
ab3 = b3 - a3
res = ab1 + ab2 - ab3

print(len(arr)- res)

### FIXED CODE ###

from fractions import gcd

def lcm(x, y):
    return (x * y) // gcd(x, y)

A,B,C,D = map(int,input().split())

ab1 = B // C -  (A-1) // C
ab2 = B // D -  (A-1) // D

lcd = lcm(C,D)

ab3 = B//lcd - (A-1)//lcd

ans = (B-A+1) - (ab1+ab2-ab3)

print(ans)
n, k, q = map(int, input().split())
point = [k - q] * n

for i in range(q):
    answer = int(input())
    point[answer - 1} += 1

for j in point:
    if j <= 0:
        print('No')
    else:
        print('Yes')

### FIXED CODE ###

n, k, q = map(int, input().split())
point = [k - q] * n

for i in range(q):
    answer = int(input())
    point[answer - 1] += 1

for j in point:
    if j <= 0:
        print('No')
    else:
        print('Yes')
N, A, B, C = map(int, input().split())
S = [list(input()) for i in range(N)]

v = [A, B, C]
id_d = {'A':0, 'B':1, 'C':2}
ans = [0] * N
for i, s in enumerate(S):
  s1, s2 = s
  id1, id2 = id_d[s1], id_d[s2]
  v1, v2 = v[id1], v[id2]
  if v1 == v2 == 0:
    if i == 0:
      print('No')
      quit()
    else:
      pre_s1, pre_s2 = S[i-1]
      pre_id1, pre_id2 = id_d[pre_s1], id_d[pre_s2]
      if pre_s1 in [s1, s2]:
        v[pre_id1] += 2
        v[pre_id2] -= 2
        ans[i-1] = pre_s1
        if v[pre_id2] < 0:
          print('No')
          quit()
      else: # pre_s2 in [s1, s2]
        v[pre_id2] += 2
        v[pre_id1] -= 2
        ans[i-1] = pre_s2
        if v[pre_id1] < 0:
          print('No')
          quit()
  v1, v2 = v[id1], v[1d2]
  if v1 >= v2:
    ans[i] = s2
    v[id1] -= 1
    v[id2] += 1
  else:
    ans[i] = s1
    v[id1] += 1
    v[id2] -= 1

print('Yes')
print(*ans, sep='\n')

### FIXED CODE ###

N, A, B, C = map(int, input().split())
S = [list(input()) for i in range(N)]

v = [A, B, C]
id_d = {'A':0, 'B':1, 'C':2}
ans = [0] * N
for i, s in enumerate(S):
  s1, s2 = s
  id1, id2 = id_d[s1], id_d[s2]
  v1, v2 = v[id1], v[id2]
  if v1 == v2 == 0:
    if i == 0:
      print('No')
      quit()
    else:
      pre_s1, pre_s2 = S[i-1]
      pre_id1, pre_id2 = id_d[pre_s1], id_d[pre_s2]
      if pre_s1 in [s1, s2]:
        v[pre_id1] += 2
        v[pre_id2] -= 2
        ans[i-1] = pre_s1
        if v[pre_id2] < 0:
          print('No')
          quit()
      else: # pre_s2 in [s1, s2]
        v[pre_id2] += 2
        v[pre_id1] -= 2
        ans[i-1] = pre_s2
        if v[pre_id1] < 0:
          print('No')
          quit()
  v1, v2 = v[id1], v[id2]
  if v1 >= v2:
    ans[i] = s2
    v[id1] -= 1
    v[id2] += 1
  else:
    ans[i] = s1
    v[id1] += 1
    v[id2] -= 1

print('Yes')
print(*ans, sep='\n')
N, A, B = map(int,input().split())

result = 0
for n in range(N):
    sm = 0
    for i in range(len(n)):
        sm += n[i]
    if A<=sm<=B:
        result += 1

print(result)

### FIXED CODE ###

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

result = 0
for n in range(1,N+1):
    sm = 0
    for i in range(len(str(n))):
        sm += int(str(n)[i])
    if A<=sm<=B:
        result += n

print(result)
s = input()
t = input()
s.sort()
t.sort(reverse=True)
print('Yes' if s<t else 'No')

### FIXED CODE ###

s = input()
t = input()
s=sorted(s)
t=sorted(t,reverse=True)
print('Yes' if s<t else 'No')
D, N = map(int,input())

print(N * (100**D))


### FIXED CODE ###

D, N = map(int,input().split())
if N == 100:
    N += 1
print(N * (100**D))
n = int(input())

h = [int(x) for x in input().split()]

max = 0
for i in n:
    if max <= h[i]:
        max = h[i]
        count += 1

print(count)

### FIXED CODE ###

N = int(input())
h = list(map(int, input().split()))
count = 0
max = 0
for i in range(N):
    if max <= h[i]:
        max = h[i]
        count += 1
print(count)
n = int(input())
a = list(map(int, input().split()))

l = [0]*200010
for i in range(n):
    l[a[i]] += 1

bool = True
for j in range(len(l)):
    if l[j] > 1:
        bool = False
    else:
        continue
        
if bool:
    print('YES')
else:
    print('NO')

### FIXED CODE ###

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

ans1 = len(set(a))
ans2 = len(a)
if ans1 == ans2:
    print('YES')
else:
    print('NO')