Harryxun/stf_run huggingface dataset:
## coding: UTF-8
from decimal import *
from itertools import permutations, combinations,combinations_with_replacement,product

s = input().split()
t = [int(p) for p in s]

sA = input().split()
p = [int(w) for w in sA]
p.sort(reverse=True) #大きい順に並べ替える


sB = input().split()
q = [int(p) for p in sB]
q.sort(reverse=True)

sC = input().split()
r = [int(p) for p in sC]
r.sort(reverse=True)

X = t[0]
Y = t[1]
A = t[2]
B = t[3]
C = t[4]
p = p[:X] #下の方はいらない子
q = q[:Y] #下の方はいらない子
r = r[:X+Y] #下の方はいらない子だけど、全部無色の可能性もある。
#print('{} {} {} {} {}'.format(X,Y,A,B,C))
#print(p)
#print(q)
#print(r)

def delete_min(p, q, r):
    if(p[-1] <= q[-1] and p[-1] <= r[-1]):
        del p[-1]
    elif(q[-1] <= r[-1]):
        del q[-1]
    else:
        del r[-1]

while len(p) + len(q) + len(r) > X + Y:
    delete_min(p, q, r)
    #print('p:{}, q:{}, r:{}'.format(p,q,r))

answer = sum(p) + sum(q) + sum(r)
print(answer)




### FIXED CODE ###

## coding: UTF-8
#最後の方のテストケースでREになってしまう。時間切れ。
from decimal import *
from itertools import permutations, combinations,combinations_with_replacement,product

s = input().split()
t = [int(p) for p in s]


sA = input().split()
p = [int(w) for w in sA]
p.sort(reverse=True) #大きい順に並べ替える


sB = input().split()
q = [int(p) for p in sB]
q.sort(reverse=True)

sC = input().split()
r = [int(p) for p in sC]
r.sort(reverse=True)

X = t[0]
Y = t[1]
A = t[2]
B = t[3]
C = t[4]
p = p[:X] #下の方はいらない子
q = q[:Y] #下の方はいらない子
r = r[:X+Y] #下の方はいらない子だけど、全部無色の可能性もある。
#print('{} {} {} {} {}'.format(X,Y,A,B,C))
#print(p)
#print(q)
#print(r)

def delete_min(p, q, r):
    if(len(p) == 0 and len(q) == 0):
        del r[-1]
    elif(len(p) == 0):
        if(q[-1] <= r[-1]):
            del q[-1]
        else:
            del r[-1]
    elif(len(q) == 0):
        if(p[-1] <= r[-1]):
            del p[-1]
        else:
            del r[-1]
    elif(len(r) == 0):
        if(p[-1] <= q[-1]):
            del p[-1]
        else:
            del q[-1]
    else:
        if(p[-1] <= q[-1] and p[-1] <= r[-1]):
            del p[-1]
        elif(q[-1] <= r[-1]):
            del q[-1]
        else:
            del r[-1]
    #要素数が0になることもありうるので、その回避処理が必要だった

while len(p) + len(q) + len(r) > X + Y:
    delete_min(p, q, r)
    #print('p:{}, q:{}, r:{}'.format(p,q,r))

answer = sum(p) + sum(q) + sum(r)
print(answer)
import sys
from collections import deque
input = sys.stdin.readline

n = int(input())
a = [deque([x for x in list(map(int, input().split()))]) for _ in range(n)]

f = True
day = 1
while(f):
  if day > 10000:
    print(-1)
    sys.exit()
  done = set()
  nokori_games = 0
  
  for m in range(n):
    la = len(a[m])
    nokori_games += la
    if m in done:
      pass
    elif la:
      teki = a[m][0]
      jibun = m + 1
      if a[teki - 1][0] == jibun and teki - 1 not in done:
        a[m].popleft()
        a[teki - 1].popleft()
        done.add(m)
        done.add(teki - 1)
        nokori_games -= 1
      elif not len(a[teki - 1]):
        print(-1)
        sys.exit()
  if nokori_games:
    if not len(done):
      print(-1)
      sys.exit()
  else:
    print(day)
    sys.exit()
  day += 1


### FIXED CODE ###

p = input()
r = input()

c = 0
for i in range(3):
  if p[i] == r[i]:
    c += 1

print(c)
K=int(input()**2//4)

### FIXED CODE ###

K=int(input())
if K%2==0:
  print(int((K/2)**2))
else:
  print(int((K-1)/2*(K+1)/2))
import numpy as np
N,K = map(int, input().split())
A = [int(input(a)) for a in input().split()]
bit_K = bin(K)
max_f = 0
for index in range(2,len(bit_K))[::-1]:
    #d-bit目まではKと同じ
    #XがKより大きくならないように、上位ビットをKに合わせる。
    d=index-2
    f=0
    for e in range(2,len(bit_K))[::-1]:
        e=e-2
        mask = 1<<e
        num=0
        for a in A:#e-bit目が立っているA[i]を数える
            if a&mask:
                num+=1
        n_num = N - num
        #A[i]のe-bit目が立っていれば、XORの計算上0になるので、e-bit目が立っていないA[i]が加算
        if e>d:#dビット目より上はKに合わせる
            #以下、e-bit目だけ計算したf(x)
            if K&mask:
                f += mask*n_num
            else:
                f += mask*num
        elif e==d:
            f += mask*num
        else:#どうせ後から計算するからなんでもよい？
            f += mask*max(n_num,num)
    max_f = max(f,max_f)
print(max_f)

### FIXED CODE ###

import sys
input = sys.stdin.readline

N, K = map(int, input().split())
A = list(map(int, input().split()))
"""
N, K = map(int, input().split())
A = [int(x) for x in input().split()]
max_A = max(A)
bit = bin(K)
if max_A > K:
    bit = bin(max_A)"""
max_f = 0
#for d in range(1,len(bit))[::-1]:
for d in range(41,-2,-1):
    #d=d-2
    if (d != -1 and not (K & 1 << d)):
        continue
    f=0
    #for e in range(2,len(bit))[::-1]:
    for e in range(41,-1,-1):
        #e=e-2
        mask = 1<<e
        num=0
        for a in A:
            if a&mask:
                num+=1
        n_num = N - num
        if e>d:
            if K&mask:
                f += mask*n_num
            else:
                f += mask*num
        elif e==d:
            f += mask*num
        else:
            f += mask*max(n_num,num)
    max_f = max(f,max_f)
print(max_f)
input(S)
if S=Sunny:
  print('Cloudy')
elif S=Cloudy:
  print('Rainy')
elif S=Rainy:
  print('Sunny')

### FIXED CODE ###

S=input()
if S=='Sunny':
    print('Cloudy')
elif S=='Cloudy':
    print('Rainy')
elif S=='Rainy':
    print('Sunny')
import numpy as np

W, H, N = map(int, input().split())
l = np.zeros((H,W))

for i in range(N):
  x, y, a = map(int, input().split())
  if a==1:
    l[:,:x] = 1
  elif a==2:
    l[:,x:] = 1
  elif a==3:
    l[:y,:] = 1
  elif a==4:
    l[y:,:] = 1
    
print(H*W-int(l.sum().sum()))


### FIXED CODE ###

import numpy as np

W, H, N = map(int, input().split())
l = np.zeros((H,W))

for i in range(N):
  x, y, a = map(int, input().split())
  if a==1:
    l[:,:x] = 1
  elif a==2:
    l[:,x:] = 1
  elif a==3:
    l[:y,:] = 1
  elif a==4:
    l[y:,:] = 1
    
print(H*W-int(l.sum().sum()))
import numpy as np
N, K = (int(i) for i in input().split())  
A = [int(i) for i in input().split()] 

def has_duplicates(seq):
  return len(seq) != len(set(seq))

lis = [1]
idx = 0

check_l = [0] * N
for i in range(N):
  lis.append(A[idx])
  if check_l[A[idx]] != 1:
    lis.pop(-1)
    found = lis.index(A[idx])
    lis.append(A[idx])
    break
  check_l[A[idx]] == 1
  idx = A[idx]-1
  
print(lis[found:i+1][(K-found) % (i - found + 1)])

### FIXED CODE ###

import numpy as np
N, K = (int(i) for i in input().split())  
A = [int(i) - 1 for i in input().split()] 
N = len(A)

def get_keys_from_value(d, val):
    return [k for k, v in d.items() if v == val][0]

now = 0
lis = []
p = {}
for i in range(N):
  now = A[now]
  if now in p:
    break
  
  p[now] = i
  lis.append(now)

if K < i:
  print(lis[K-1] + 1)
else:
  print(lis[(K-i-1) % (i - p[now]) + p[now]] + 1)
n,a,b,c,d = map(int,input().split())
s = input()
if c < d:
    #最後まで動かす
    flg = True
else:#c>d
    if '...' in s[a-1:]:
        flg = True
        if not(c-d==2 and '...' in s[:d-1]):
            flg = False
if '##' in s:
    flg = False
if flg:
    print('Yes')
else:
    print('No')



### FIXED CODE ###

n,a,b,c,d = map(int,input().split())
s = input()
flg = False
if c < d:
    #最後まで動かす
    flg = True
else:#c>d
    if '...' in s[b-2:d+1]:
        flg = True
if '##' in s[a-1:max(d,c)-1]:
    flg = False
if flg:
    print('Yes')
else:
    print('No')
N = int(input())
A = [int(x) for x in input().split()]

# M以下の整数の素因数分解を高速に
# 前処理O(MloglogM)
# 一計算O(logK)
def mae_syori(M):
    D = [0] * (M + 1)
    for i in range(2, M+1):
        if D[i] != 0: continue
    #     print(i, list(range(i*2, M + 1, i)))
        for j in range(i*2, M+1, i):
            if D[j] == 0:
                D[j] = i
    return D

def p_bunkai(K):
    assert 2 <= K <= len(D)-1
    k = K
    ret = []
    while True:
        if k == 1:
            break
        if D[k] == 0:
            ret.append((k, 1))
            break
        else:
            p = D[k]
            count = 0
            while k % p == 0:
                count += 1
                k //= p
            ret.append((p, count))
    return ret
 

# 最大公約数
# ユークリッドの互除法
def my_gcd(a, b):
    if b == 0:
        return a
    else:
        return my_gcd(b, a%b)

c_gcd = A[0]
for a in A:
    c_gcd = my_gcd(c_gcd, a)

if c_gcd == 1:
    max_A = max(A)
    D = mae_syori(max_A)
    yakusu = set()
    ok = True
    for a in A:
        p_bunkai_result = p_bunkai(a)
        p_list = [p[0] for p in p_bunkai_result]
        for p in p_list:
            if p not in yakusu:
                yakusu.add(p)
            else:
                ok = False
        if not ok:
            break
    if ok:
        print('pairwise coprime')
    else:
        print('setwise coprime')
else:
    print('not coprime')

### FIXED CODE ###

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

# M以下の整数の素因数分解を高速に
# 前処理O(MloglogM)
# 一計算O(logK)
def mae_syori(M):
    D = [0] * (M + 1)
    for i in range(2, M+1):
        if D[i] != 0: continue
    #     print(i, list(range(i*2, M + 1, i)))
        for j in range(i*2, M+1, i):
            if D[j] == 0:
                D[j] = i
    return D

def p_bunkai(K):
    assert 2 <= K <= len(D)-1
    k = K
    ret = []
    while True:
        if k == 1:
            break
        if D[k] == 0:
            ret.append((k, 1))
            break
        else:
            p = D[k]
            count = 0
            while k % p == 0:
                count += 1
                k //= p
            ret.append((p, count))
    return ret
 

# 最大公約数
# ユークリッドの互除法
def my_gcd(a, b):
    if b == 0:
        return a
    else:
        return my_gcd(b, a%b)

c_gcd = A[0]
for a in A:
    c_gcd = my_gcd(c_gcd, a)

if c_gcd == 1:
    max_A = max(A)
    D = mae_syori(max_A)
    yakusu = set()
    ok = True
    for a in A:
        if a == 1: continue
        p_bunkai_result = p_bunkai(a)
        p_list = [p[0] for p in p_bunkai_result]
        for p in p_list:
            if p not in yakusu:
                yakusu.add(p)
            else:
                ok = False
        if not ok:
            break
    if ok:
        print('pairwise coprime')
    else:
        print('setwise coprime')
else:
    print('not coprime')
n, M, k = map(int,input().split())
a_l = list(map(int,input().split()))
b_l = list(map(int,input().split()))
read_a = [0]*n
read_b = [0]*M
time = 0
ans = 0
memo = 0
for j in range(n):
    if time + a_l[j] <= k:
        time += a_l[j]
        read_a[j] = 1
        memo = j
        ans = j+1
    else:
        break

kotae = [ans]


def dfs(i,a,t,m):
    global kotae
    if i < M:
        if b_l[i] + t <= k:
            tt = t + b_l[i]
            aa = a + 1
            kotae.append(aa)
            ii = i+1
            mm = m
            #print(aa)
            dfs(ii,aa,tt,mm)
            
        else:
            tt = t - a_l[m]
            mm = m - 1
            aa = a - 1
            ii = i
            #print(aa)
            dfs(ii,aa,tt,mm)
            #print(aa)


dfs(0,ans,time,memo)


print(max(kotae))
    





### FIXED CODE ###

import sys
sys.setrecursionlimit(10**6)
n, M, k = map(int,input().split())
a_l = list(map(int,input().split()))
b_l = list(map(int,input().split()))
read_a = [0]*n
read_b = [0]*M
time = 0
ans = 0
memo = -1
for j in range(n):
    if time + a_l[j] <= k:
        time += a_l[j]
        read_a[j] = 1
        memo = j
        ans = j+1
    else:
        break

kotae = [ans]


def dfs(i,a,t,m):
    global kotae
    if i < M:
        if b_l[i] + t <= k:
            tt = t + b_l[i]
            aa = a + 1
            kotae.append(aa)
            ii = i+1
            mm = m
            #print(aa)
            dfs(ii,aa,tt,mm)
            
        else:
            if m >= 0:
                tt = t - a_l[m]
                mm = m - 1
                aa = a - 1
                ii = i
                dfs(ii,aa,tt,mm)
            


dfs(0,ans,time,memo)


print(max(kotae))
N = int(input())
S = list(input())

if S == ['#'] * N or S == ['.'] * N:
    print(0)
    exit()
ans = 0
b, w = 0, 0
for j in range(N):
    if S[j] == '.':
        w += 1
    else:
        b += 1
    if b == w and b != 0 and w != 0:
        ans += b
        num = j
        b, w = 0, 0

b, w = 0, 0
for j in range(N - 1, num - 1, -1):
    if S[j] == '.':
        w += 1
    else:
        b += 1
    if b == w and b != 0 and w != 0:
        ans += b
        b, w = 0, 0

print(ans)

### FIXED CODE ###

N = int(input())
S = list(input())

w_cnt = [0]
w = 0
for s in S:
    if s == '.':
        w += 1
    w_cnt.append(w)

b_cnt = [0]
b = 0
for s in S[::-1]:
    if s == '#':
        b += 1
    b_cnt.append(b)
b_cnt.reverse()


ans = float('inf')
i = 0
for b, w in zip(b_cnt, w_cnt):
    ww, bb = i, N - i
    ans = min(ans, abs(b - bb) + abs(w - ww))
    i += 1
print(ans)
for i in range(1,10000):
    x = int(input())
    if x == 0:
        break:
    else:
        print('Case %i: %i' % (i, x))


### FIXED CODE ###

#
# 3b
#

def main():
    i = 1
    while True:
        x = int(input())
        if x == 0:
            break
        print(f"Case {i}: {x}")
        i += 1


if __name__ == '__main__':
    main()
s = input()

if S == 'Sunny':
    print('Cloudy')
elif S =='Cloudy':
    print('Rainy')
else:
    print('Sunny')

### FIXED CODE ###

S = input()

if S == 'Sunny':
    print('Cloudy')
elif S =='Cloudy':
    print('Rainy')
else:
    print('Sunny')
import collections
n=int(input())
a=list(map(int,input().split()))
d=collections.Counter(a)
total=sum([(v-1)*v//2, for v in d.values()])
for x in a:
    print(total-d[x]+1)

### FIXED CODE ###

n=int(input())
a=list(map(int,input().split()))
d={}
for x in a:
    if d.get(x) is None:
        d[x]=1
        continue
    d[x]+=1
total=0
for v in d.values():
    total+=(v-1)*v//2
for x in a:
    print(total-d[x]+1)
n = int(input())
a = list(map(int,input().split()))

M = max(a)

def counter(x):
    cnt = 0
    for i in range(n):
        if a[i] == x or a[i] - 1 == x or a[i] + 1 == x:
            cnt += 1
    return cnt

cnt_list =[]
for j in range(M):
    cnt_list.append(counter(j))

print(max(cnt_list))

### FIXED CODE ###

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

ans = 0

cnt = [0]*100001

for i in a:
    cnt[i] += 1

for i in range(len(cnt)-2):
    ans = max(ans,cnt[i]+cnt[i+1]+cnt[i+2])

print(ans)
input1 = list(map(int,input().split()))
A = input1[0]
B = input1[1]
C = input1[2]
D = input1[3]
if A * B >= C * D
  print(A * B)
else:
  print(C * D)

### FIXED CODE ###

input1 = list(map(int,input().split()))
A = input1[0]
B = input1[1]
C = input1[2]
D = input1[3]
if A * B >= C * D:
  print(A * B)
else:
  print(C * D)
import numpy as np
n=int(input())
a=np.array(list(map(int,input().split())))
x=np.zeros((n,n))
for i in range(n):
  x[i][i]=0.5
  if i!=n-1:
    x[i][i+1]=0.5
  else:
    x[i][0]=0.5
#inv_x=np.linalg.inv(x)
#ans=np.dot(inv_x,a)
ans=np.linalg.solve(x,a)
ans=ans.tolist()
ans=list(map(str,map(int,ans)))
print(" ".join(ans))


### FIXED CODE ###

n=int(input())
a=list(map(int,input().split()))
ans=[0]*n
ans[0]=sum(a[::2])-sum(a[1::2])
for i in range(1,n):
  ans[i]=2*a[i-1]-ans[i-1]
ans=list(map(str,ans))
print(" ".join(ans))
N, M = map(int, input().split())
A = []
for _ in range(N):
    a = input()
    A.append(a)

B = []
for _ in range(M):
    b = input()
    B.append(b)

idx = [0, 0]
while True:
    if idx[0] == N - 1 and idx[1] == N:
        break
    if A[idx[0]][idx[1]] == B[0][0]:
        check = False
        for i in range(M):
            for j in range(M):
                if 0 <= idx[0] + i < N and 0 <= idx[1] + j < N:
                    if A[idx[0] + i][idx[1] + j] != B[i][j]:
                        check = True
                        break
                else:
                    check = True
                    break
            if check:
                break

        if not check:
            print('Yes')
            exit()
    if idx[1] < N - 1:
        idx[1] += 1
        continue
    else:
        idx[0] += 1
        idx[1] = 1
        continue

print('No')


### FIXED CODE ###

N, M = map(int, input().split())
A = [input() for _ in range(N)]
B = [input() for _ in range(M)]


for i in range(N - M + 1):
    for j in range(N - M + 1):
        check = True
        count = 0
        for k in range(M):
            if (A[i + k][j: j + M] == B[k]):
                # print(A[i + k][j:j + M], B[k])
                count += 1
                continue
            else:
                check = False
                break

        if (check and count == M):
            print('Yes')
            exit()

print('No')
from sys import stdin

readline = stdin.readline


def ns():
    """
    入力を`[\\s]`を除いて文字列として取得
    """
    return readline().rstrip()


def ni():
    """
    入力を`int`に変換
    """
    return int(ns())


def nf():
    """
    入力全て(EOFまで)を`int iter`に変換
    """
    return map(int, open(0).read().split())


def main():
    n = ni()
    a = list(nf())
    for i in range(n):
        tmp = a[:]
        tmp.pop(i)
        print(max(tmp))


if __name__ == "__main__":
    main()


### FIXED CODE ###

from sys import stdin

readline = stdin.readline


def nf():
    """
    入力全て(EOFまで)を`int iter`に変換
    """
    return map(int, open(0).read().split())


def main():
    n, *al = nf()
    s, f = sorted(al)[-2:]
    if s == f:
        for _ in range(n):
            print(f)
        return
    for a in al:
        if a == f:
            print(s)
            continue
        print(f)


if __name__ == "__main__":
    main()
n, k = map(int, input().split())
d = set([str(i) for i in input().split()])
c = 0
for i in range(1, 10):
    c += n
    t = set(list(str(c)))
    if len(t & d) == 0:
        ans = c
        break
print(ans)

### FIXED CODE ###

n, k = map(int, input().split())
d = [str(i) for i in input().split()]
for i in range(n, 10*n+1):
    if len(set(list(str(i))) & set(d)) == 0:
        print(i)
        break
import sys

# 関数 solve は，もちろん，問題に応じて書き換える
def solve(a,b,c,d):
    x = c-a
    y = d-b
    x3 = 0
    x4 = 0
    y3 = 0
    y4 = 0
    #print(x,y)
    x3 = c-y
    y3 = d+x
    x4 = x3-x
    y4 = y3-y
    return x3,x4,y3,y4

# ここから下は，入力・出力形式が同じであれば，変えなくて良い．
def readQuestion():
    line = sys.stdin.readline().rstrip()
    [str_a, str_b, str_c, str_d] = line.split(' ')
    return (int(str_a), int(str_b), int(str_c)), int(str_d))

def main():
    a, b, c, d = readQuestion()
    answer = solve(a, b, c, d)
    print(answer)
    
if __name__ == '__main__':
    main()

### FIXED CODE ###

import sys

# 関数 solve は，もちろん，問題に応じて書き換える
def solve(a,b,c,d):
    x = c-a
    y = d-b
    x3 = 0
    x4 = 0
    y3 = 0
    y4 = 0
    #print(x,y)
    x3 = c-y
    y3 = d+x
    x4 = x3-x
    y4 = y3-y
    return str(x3) + ' '  + str(y3) + ' ' + str(x4) + ' ' + str(y4) + ' '

# ここから下は，入力・出力形式が同じであれば，変えなくて良い．
def readQuestion():
    line = sys.stdin.readline().rstrip()
    [str_a, str_b, str_c, str_d] = line.split(' ')
    return (int(str_a), int(str_b), int(str_c), int(str_d))

def main():
    a, b, c, d = readQuestion()
    answer = solve(a, b, c, d)
    print(answer)
    
if __name__ == '__main__':
    main()
import math
N = int(input())
print((math.factoral(N))%(10**9 + 7))


### FIXED CODE ###

import math
n=int(input())
print(math.factorial(n)%(10**9+7))
n = int(input())

if k == 3:
    print('Yes')
    print(k)
    print(2, 1, 2)
    print(2, 3, 1)
    print(2, 2, 3)

else:
    print('No')

### FIXED CODE ###

n = int(input())

k = 0
for i in range(1, 2*n+1):
    if i*(i-1) == 2*n:
        k = i

#print(k)
if not k:
    print('No')
    exit()

S = [[] for _ in range(k)]
import itertools
C = list(itertools.combinations(range(k),2))
for i in range(n):
    j = i+1
    c1, c2 = C[i]
    S[c1].append(j)
    S[c2].append(j)

print('Yes')
print(k)
for i in range(k):
    print(len(S[i]), *S[i])
def fun(a,k,n): ## k different steps can be taken
    if n==1:
        return 0
    dp = [0]*n
    dp[1]=dp[0]+abs(a[0]-a[1])
    for i in range(2,len(a)):
        t = 0
        min_ = float('inf')
        for j in range(i-1,-1,-1):
            if t==k:
                break
            else:
                t+=1
            if dp[j]+abs(a[i]-a[j]) < min_ :
                   min_ = dp[j]+abs(a[i]-a[j])
        dp[i]=min_
    return dp[-1]
from sys import stdin , stdout
n,k = map(int , stdin.readline().split())
a = list(map(int , stdin.readline().split()))
print(fun(a,k,n))

### FIXED CODE ###

def fun(a):
    if len(a)==1:
        return 0
    dp = [0]*len(a)
    dp[0]=a[0]
    dp[1]=dp[0]+abs(a[0]-a[1])
    for i in range(2,len(a)):
        dp[i]=min(dp[i-1]+abs(a[i]-a[i-1]) ,dp[i-2]+abs(a[i]-a[i-2]))
    return dp[-1]-a[0]
  
n = int(input())
a = list(map(int , input().split()))
print(fun(a))
from collections import defaultdict, deque, Counter
from heapq import heappush, heappop, heapify
import math
import bisect
import random
from itertools import permutations, accumulate, combinations
import sys
import string
from bisect import bisect_left


INF = float('inf')
def LI(): return list(map(int, sys.stdin.readline().split()))
def I(): return int(sys.stdin.readline())
def LIM(): return list(map(lambda x:int(x) - 1, sys.stdin.readline().split()))
def LS(): return sys.stdin.readline().split()
def S(): return sys.stdin.readline().strip()
def IR(n): return [I() for i in range(n)]
def LIR(n): return [LI() for i in range(n)]
def LIRM(n): return [LIM() for i in range(n)]
def SR(n): return [S() for i in range(n)]
def LSR(n): return [LS() for i in range(n)]
def SRL(n): return [list(S()) for i in range(n)]
mod = 1000000007


n =  I()
que = []
for i in LI():
    heappush(que, -i)



L = [heappop(que)]
for i in range(n):
    a = [i + 1 for i in L]
    for j in a:
        heappush(L, j)



heappop(L)
for i in range(n**2-1):
    if -heappop(L) < -heappop(que):
        print('No')
        break
else:
    print('Yes')

### FIXED CODE ###

from collections import defaultdict, deque, Counter
from heapq import heappush, heappop, heapify
import math
import bisect
import random
from itertools import permutations, accumulate, combinations
import sys
import string
from bisect import bisect_left


INF = float('inf')
def LI(): return list(map(int, sys.stdin.readline().split()))
def I(): return int(sys.stdin.readline())
def LIM(): return list(map(lambda x:int(x) - 1, sys.stdin.readline().split()))
def LS(): return sys.stdin.readline().split()
def S(): return sys.stdin.readline().strip()
def IR(n): return [I() for i in range(n)]
def LIR(n): return [LI() for i in range(n)]
def LIRM(n): return [LIM() for i in range(n)]
def SR(n): return [S() for i in range(n)]
def LSR(n): return [LS() for i in range(n)]
def SRL(n): return [list(S()) for i in range(n)]
mod = 1000000007



def main():
    n =  I()
    final_slime = sorted(LI(), reverse=True)
    now_slime = [final_slime[0]]
    made_or_not = [0] * (2 ** n)
    made_or_not[0] = 1
    for i in range(n):
        k = 0
        for j in range(len(now_slime)):
            flag = 1
            while flag:
                if k == 2 ** n:
                    return 'No'
                if made_or_not[k] == 0 and now_slime[j] - 1 >= final_slime[k]:
                    now_slime += [final_slime[k]]
                    made_or_not[k] = 1
                    flag = 0
                k += 1
        now_slime.sort(reverse=True)
    return 'Yes'



print(main())
n,k = map(int,input().split())
p = [(int(i)+1)/2 for i in input().split()]

sump = [0]*n
sump[0]=p[0]
for i in range(n-1):
    sump[i+1] = sump[i]+p[i+1]
ans=max(sump[i+k]-sump[i] for i in range(n-k))
print(ans)

### FIXED CODE ###

n,k = map(int,input().split())
p = [(int(i)+1)/2 for i in input().split()]


if n==k:
    print(sum(p))
else:
    sump = [0]*n
    sump[0]=p[0]
    for i in range(n-1):
        sump[i+1] = sump[i]+p[i+1]
    ans=max(sump[i+k]-sump[i] for i in range(n-k))
    print(ans)
if __name__ == '__main__':
    n, = map(int, input())
    a = list(map(int, input().split()))
    flag = True
    for i in range(0, n):
        b = i - 1
        c = i + 1
        if b < 0:
            b = n - 1
        if c >= n:
            c = 0
        if a[b] ^ a[c] != a[i]:
            flag = False
            break
    if flag:
        print("Yes")
    else:
        print("No")


### FIXED CODE ###

if __name__ == '__main__':
    n = int(input())
    l = list(map(int, input().split()))
    num = l[0]
    for i in range(1, n):
        num = num ^ l[i]
    if num == 0:
        print("Yes")
    else:
        print("No")