Harryxun/stf_run huggingface dataset:
x = int(input())
y = int(input())

total = 0

rewards = {1: 300000, 2: 200000, 3: 100000}

x1 = rewards[x]
y2 = rewards[y]

if (x == 1 and y ==  1):
  	total += 400000
total += (x1 + y1)

print(total)


### FIXED CODE ###

x, y = map(int, input().split(" "))
 
total = 0
 
rewards = {1: 300000, 2: 200000, 3: 100000}

x1 = rewards[x] if (x <= 3) else 0
y1 = rewards[y] if (y <= 3) else 0
 
if (x == 1 and y ==  1):
  total += 400000
if (x1 != None):
  total += x1
if (y1 != None):
  total += y1
 
print(total)
n,m = map(int,input().split())
sc = [list(map(int,input().split())) for _ in range(m)]

ans = [0]*n
judge_s = 0
judge_c = 0
sc = sorted(sc)
for i in range(m):
    if judge_s == sc[i][0] and judge_c != sc[i][1]:
        ans = -1
        break
    judge_s = sc[i][0]
    judge_c = sc[i][1]
    ans[sc[i][0]-1] = sc[i][1]


if ans != -1:
    if ans[0] == 0:
        ans = -1
    else:
        ans = 0
        for i in range(n):
            ans += ans[i]*10**(n-i-1)
    
print(ans)

### FIXED CODE ###

n,m = map(int,input().split())
sc = [list(map(int,input().split())) for _ in range(m)]

ans = [0]*n
judge_s = 0
judge_c = 0
sc = sorted(sc)

if m == 0:
    if n == 1:
        ans = 0
    else:
        ans = 10**(n-1)
else:
    for i in range(m):
        if judge_s == sc[i][0] and judge_c != sc[i][1]:
            ans = -1
            break
        if n != 1 and sc[i] == [1,0]:
            ans = -1
            break
        judge_s = sc[i][0]
        judge_c = sc[i][1]
        ans[sc[i][0]-1] = sc[i][1]


    if ans != -1:
        ans_ = ans.copy()
        ans = 0
        for i in range(n):
            ans += ans_[i]*10**(n-i-1)
        
        if ans_[0] == 0 and n != 1:
            ans += 10**(n-1)
            
    
print(ans)
import sys
sys.setrecursionlimit(10000)

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

A -= 1
B -= 1
C -= 1
D -= 1


def check(s, start, goal, ans):
    if start == goal:
        return 1
    if s[start] == '#':
        return 0
    if start + 1 <= N - 1:
        ans += check(s, start + 1, goal, ans)
    if start + 2 <= N - 1:
        ans += check(s, start + 2, goal, ans)
    return ans

ans = 0
if not check(s, B, D, ans):
    print("No")
    exit()
#s[D] = '#'
if not check(s, A, C, ans):
    print("No")
    exit()
print("Yes")

### FIXED CODE ###

import sys
sys.setrecursionlimit(100000000)
 
N, A, B, C, D = map(int, input().split())
s = list(input())
 
A -= 1
B -= 1
C -= 1
D -= 1
 
for i in range(len(s)):
    if i == len(s) - 1:
        continue
    else:
        if s[i] == '#' and s[i+1] == '#' and max(C, D) < i and i <= C:
            print("No")
            exit()
 
if D < C:
    tmp = 0
    for i in range(len(s)):
        if i == len(s) - 2 or i == len(s) - 1:
            continue
        else:
            if s[i] == '.' and s[i+1] == '.' and s[i+2] == '.' and B <= i + 1 <= D:
                tmp = 1
    if tmp != 1:
        print("No")
        exit()
 
 
 
def check(s, start, goal, ans):
    if start == goal:
        return 1
    if s[start] == '#':
        return 0
    if start + 1 <= N - 1:
        ans += check(s, start + 1, goal, ans)
    if start + 2 <= N - 1:
        ans += check(s, start + 2, goal, ans)
    return ans
 
ans = 0
if not check(s, B, D, ans):
    print("No")
    exit()
#s[D] = '#'
if not check(s, A, C, ans):
    print("No")
    exit()
print("Yes")
nums = input().split()
a = int(nums[0])
b = int(nums[1])
if a < b:
    print('a < b')
elsF a > b;
    print('a > b')
else:
    print('a == b')

### FIXED CODE ###

nums = input().split()
a = int(nums[0])
b = int(nums[1])
if a < b:
    print('a < b')
elif a > b:
    print('a > b')
else:
    print('a == b')
n = int(input())

for i in range(1,10):
  for s in range(1,10):
    if i*s==n:
      print("Yes")
      exit()
print("No")
    
    

### FIXED CODE ###

a,b = map(int,input().split())

if a>=10 or b>=10:
  print("-1")
else:
  print(a*b)
n,m = map(int,input().split())
sc = [[int(i) for i in input().split()] for j in range(m)]

ans = [10 for i in range(3)]

sc.sort()

ini_pos = sc[0][0]
ini_val = sc[0][1]
ans[ini_pos-1] = ini_val

for i in range(m-1):
    if sc[i+1][0] == ini_pos:
        if sc[i+1][1] != ini_val:
            print(-1)
            exit()
    else:
        ini_pos = sc[i+1][0]
        ini_val = sc[i+1][1]
        ans[ini_pos-1] = ini_val

if ans[0] == 0:
    print(-1)
    exit()

value = 0

for i in range(n):
    if ans[i] != 10:
        value += ans[i] * 10 ** (n-i-1)

print(value)

### FIXED CODE ###

n,m = map(int,input().split())
sc = [[int(i) for i in input().split()] for j in range(m)]

if m == 0:
    if n == 3:
        print(100)
        exit()
    elif n == 2:
        print(10)
        exit()
    elif n== 1:
        print(0)
        exit()

ans = [10 for i in range(n)]

sc.sort()

ini_pos = sc[0][0]
ini_val = sc[0][1]
ans[ini_pos-1] = ini_val

for i in range(m-1):
    if sc[i+1][0] == ini_pos:
        if sc[i+1][1] != ini_val:
            print(-1)
            exit()
    else:
        ini_pos = sc[i+1][0]
        ini_val = sc[i+1][1]
        ans[ini_pos-1] = ini_val

if ans[0] == 0:
    if n == 1:
        print(0)
        exit()
    else:
        print(-1)
        exit()

value = 0

for i in range(n):
    if i == 0:
        if ans[i] == 10:
            value += 10 ** (n-i-1)
            continue
    if ans[i] != 10:
        value += ans[i] * 10 ** (n-i-1)

print(value)
x, y = int(map, input().split())

if(2*x <= y <= 4*x and y%2==0):
    print("Yes")
else:
    print("No")

### FIXED CODE ###

x, y = map(int, input().split())

if(2*x <= y <= 4*x and y%2==0 and x <= 50):
    print("Yes")
else:
    print("No")
n = int(input())
S = [list(input()) for i in range(n)]

M = [[] for i in range(n)]
for i in range(n):
    for j in range(n):
        if S[i][j] == "1":
            M[i].append(j)
ans = -1
owa = 0
for i in range(n):
    a0 = -1
    Q = [[0] * 2 for i in range(n+3)]
    Q[0] = [i, 0]
    st = 0
    ri = 1
    D = [-1] * n
    while st < ri:
        a = Q[st][0]
        d = Q[st][1]
        D[a] = d
        for x in M[a]:
            if D[x] == -1:
                Q[ri] = [x, d+1]
                ri += 1
            elif D[x] != d-1 and D[x] != d+1:
                owa = 1
                break
        if owa == 1:
            break
        st += 1
    if owa == 0:
        a0 = max(D)+1
    ans = max(ans, a0)

print(ans)


### FIXED CODE ###


n = int(input())
S = [list(input()) for i in range(n)]

M = [[] for i in range(n)]
for i in range(n):
    for j in range(n):
        if S[i][j] == "1":
            M[i].append(j)
ans = -1
owa = 0
for i in range(n):
    a0 = -1
    Q = [[i, 0]]
    st = 0
    D = [-1] * n
    while st < len(Q):
        a = Q[st][0]
        d = Q[st][1]
        D[a] = d
        for x in M[a]:
            if D[x] == -1:
                Q.append([x, d+1])
                D[x] = d+1
            elif D[x] != d-1 and D[x] != d+1:
                owa = 1
                break
        if owa == 1:
            break
        st += 1
    if owa == 0:
        a0 = max(D)+1
    ans = max(ans, a0)

print(ans)
import sys
a, b = sys.stdin.readline().split()

print((a+b)%24)

### FIXED CODE ###

import sys
a, b = map(int, sys.stdin.readline().split())

print((a+b)%24)
dpの基本形
#漸化式を立てる
#nを与えられて求めるので、求める物をdp[n]とおいてみる
#dp[1]は１円払うのに必要な回数、dp[2]は...dp[n-1]まで知っている状態で、dp[n]はn円払うのに必要な回数を調べていくと考える


#場合１：dp[n]は、dp[n-1]にさらに1円を払う回数１回を足した回数である
#場合２：dp[n]は、dp[n-6]にさらに6円を払う回数１回を足した回数
#場合３：...

#これら全部の最小値を取れば良い！なるほど。
#でも参照できない物もあるから、参照できるやつだけ取り出すと良いだろう。



n = int(input())
pre_list = [1,6,9,36,81,216,729,1296,6561,7776,46656,59049]

#nをn+1個並べたリストを作る
dp = [n]*(n+1)
#0を初期化する
dp[0] = 0


#dp[i]について一つずつ考える
for i in range(1,n+1):
#dp[i]のそれぞれの場合分けについて考える。場合はpre_listの中身の分だけ回せばいい
	for j in pre_list:
		if i - j >= 0:
			dp[i] = min(dp[i],dp[i-j]+1)

print(dp[n])


### FIXED CODE ###


n = int(input())
pre_list = [1,6,9,36,81,216,729,1296,6561,7776,46656,59049]
 
#nをn+1個並べたリストを作る
dp = [n]*(n+1)
#0を初期化する
dp[0] = 0
 
 
#dp[i]について一つずつ考える
for i in range(1,n+1):
#dp[i]のそれぞれの場合分けについて考える。場合はpre_listの中身の分だけ回せばいい
	for j in pre_list:
		if i - j >= 0:
			dp[i] = min(dp[i],dp[i-j]+1)
 
print(dp[n])
n=int(raw_input())
A=map(int, raw_input().split())
q=int(raw_input())
m=map(int, raw_input().split())

def solve(j, m):
  if m == 0:
    return 1
  if j >= n or sum(A)<m:
    return 0
  res = solve(j + 1, m) or solve(j + 1, m - A[j])
  return res

for i range(0,q):
  if solve(0,m[i]):
    print "yes"
  else:
    print "no"

### FIXED CODE ###

n=int(raw_input())
A=map(int, raw_input().split())
q=int(raw_input())
m=map(int, raw_input().split())

def solve(j, m):
  if m == 0:
    return 1
  if j >= n or m > sum(A):
    return 0
  res = solve(j + 1, m) or solve(j + 1, m - A[j])
  return res

for i in range(0,q):
  if solve(0,m[i]):
    print "yes"
  else:
    print "no"
import sys
input = sys.stdin.readline

def main():
    n,m=map(int,input().split())
    a=sorted(list(map(int,input().split())))
    a.reverse()
    l,r=2*a[-1],2*a[0]
    x=(l+r)//2
    while l+1<r:
        cnt=0
        for A in a:
            for B in a:
                if A+B>=x:
                    cnt+=1
                else:
                    break
        if cnt>=m:
            l=x
        else:
            r=x
        x=(l+r)//2
    s,cnt=0,0
    for A in a:
        for B in a:
            if A+B>=l:
                cnt+=1
                s+=A+B
            else:
                break
    print(s+(m-cnt)*l)
    
if __name__ == '__main__':
    main()

### FIXED CODE ###

s,t=map(str,input().split())
print(t+s)
a=input()
if a % 2 == 0:
  print(a)
else:
  print(a * 2)

### FIXED CODE ###

n=int(input())
print(n if not n%2 else n*2)
a, b, c = map(int ,input().split())
if a < b < c:
   print(Yes) 
else:
   print(No)

### FIXED CODE ###

a, b, c = map(int ,input().split())
if a < b < c:
   print("Yes") 
else:
   print("No")
n = int(input())

ans = 0
ans1 = [0] * n
for i in range(1,100):
  for j in range(1,100):
    for k in range(1,100):
      ans = i**2 + j**2 +k**2 + i*j + j*k + k*i
      if(l+1 < 10000):
        ans1[l] += 1
for i in range(n):
  print(ans1[i])


### FIXED CODE ###

n = int(input())

ans = 0
ans1 = [0] * 10050
for i in range(1,105):
  for j in range(1,105):
    for k in range(1,105):
      ans = i**2 + j**2 +k**2 + i*j + j*k + k*i
      if(ans < 10050):
        ans1[ans] += 1
for i in range(n):
  print(ans1[i+1])
import math
n=int(input)
l=[int(input) for _ in range(5)]
print(ceil(n/min(l)+4))


### FIXED CODE ###


import math
n=int(input())
l=[int(input()) for _ in range(5)]
print(math.ceil(n/min(l)+4))
import math
MOD = 1000000000+7
X, Y = map(int, input().split())




if ((2*Y-X)%3 != 0) or ((2*X-Y)%3 != 0):
    print(0)
else:
    x = (2*Y-X) // 3
    y = (2*X-Y) // 3
    fac_list = [None for _ in range(x+y+2)]
    inv_fac_list = [None for _ in range(x+y+2)]

    fac_list[0] = 1
    for i in range(1, x+y+2):
        print(i)
        fac_list[i] = i * fac_list[i-1] % MOD

    inv_fac_list[x+y+1] = pow(fac_list[x+y+1],(MOD - 2), MOD)
    for i in range(x+y, 0, -1):
        inv_fac_list[i] = inv_fac_list[i+1] * (i+1) % MOD

    print((fac_list[x+y] * inv_fac_list[x] * inv_fac_list[y]) % MOD)

### FIXED CODE ###

import math
MOD = 1000000000+7
X, Y = map(int, input().split())

if ((2*Y-X)%3 != 0) or ((2*X-Y)%3 != 0) or (2*Y-X) < 0 or (2*X-Y) < 0:
    print(0)
elif 2 *Y == X or 2 * X == Y:
    print(1)
else:
    x = (2*Y-X) // 3
    y = (2*X-Y) // 3
    fac_list = [None for _ in range(x+y+2)]
    inv_fac_list = [None for _ in range(x+y+2)]

    fac_list[0] = 1
    for i in range(1, x+y+2):
        fac_list[i] = i * fac_list[i-1] % MOD

    inv_fac_list[x+y+1] = pow(fac_list[x+y+1],(MOD - 2), MOD)
    for i in range(x+y, 0, -1):
        inv_fac_list[i] = inv_fac_list[i+1] * (i+1) % MOD

    print((fac_list[x+y] * inv_fac_list[x] * inv_fac_list[y]) % MOD)
a = [int(x) for x in input().split( )]
a.sort()
print(a[0] a[1] a[2])



### FIXED CODE ###

a = [int(x) for x in input().split( )]
print(' '.join(map(str,sorted(a))))
n=int(input())
I=list(map(int,input().split()))
num=1000
if max(I)==I[0]:
    print("1000")
    exit()
for i in range(1,n+1):
    if I[i-1]<I[i]:
        num-=(num//I[i-1])*I[i-1]
        num+=(num//I[i-1])*I[i]

print(num)


### FIXED CODE ###

n=int(input())
I=list(map(int,input().split()))
num=1000
for i in range(n-1):
    if I[i]<I[i+1]:
        p=num//I[i]
        num-=p*I[i]
        num+=p*I[i+1]

print(num)
A,B = map(int,input().split())
L = list(range(A,B+1))

ans = 0
for l in L:
    ans = ans^l

print(ans)

### FIXED CODE ###

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

def xor(n):
    m = n+1
    return m//2%2 + n*(m%2)

print(xor(B)^xor(A-1))
import math
import numpy

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

max_num=max(a)
middle_num=math.ceil(max_num/2)
middle_num_up=middle_num
middle_num_down=middle_num

if n>2:
    while True:
        if middle_num_up in a:
            ans=middle_num_up
            break
        if middle_num_down in a:
            ans=middle_num_down
            break
        else:
            middle_num_up+=1
            middle_num_down-=1
else:
    ans=min(a)

print("{} {}".format(max_num,ans)

### FIXED CODE ###

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

max_num=max(a)
middle_num=max_num/2
num=0

for i in range(n):
    if a[i]> middle_num:
        num=i
        break

if middle_num-a[num-1]<=-middle_num+a[num]:
    print("{} {}".format(max_num,a[num-1]))
else:
    print("{} {}".format(max_num,a[num]))
N=int(input())
p=list(map(int,input().split()))
count=0
import collections

s=collections.deque()
t=set()
for i in range(N):
  if p[i]==i+1:
    s.append(i)
    t.add(i)
ans=0
id=0
while(id<N):
  if id in t:
    if x+1 in t:
      id+=1
    ans+=1
  id+=1
  
  
print(ans)


### FIXED CODE ###

N=int(input())
p=list(map(int,input().split()))
count=0
t=set()
for i in range(N):
  if p[i]==i+1:
    t.add(i)
ans=0
id=0
while(id<N):
  if id in t:
    if id+1 in t:
      id+=1
    ans+=1
  id+=1
  
  
print(ans)
import sys
input = sys.stdin.readline
a, b, x = [int(x) for x in input().split()]
B = 1 + b // x
if a == 0:
    print(B)(
elif a % x == 0:
    A = 1 + a // x
    print(B - A + 1)
else:
    A = 1 + a // x
    print(B - A)


### FIXED CODE ###

import sys
input = sys.stdin.readline
a, b, x = [int(x) for x in input().split()]
B = 1 + b // x
if a == 0:
    print(B)
elif a % x == 0:
    A = 1 + a // x
    print(B - A + 1)
else:
    A = 1 + a // x
    print(B - A)
from collections import deque
import numpy as np


def main():
    n,m = map(int,input().split())
    arr = np.zeros([n, n], dtype=int)
    for _ in range(m):
        a, b = map(int,input().split())
        arr[a-1][b-1] = 1
        arr[b-1][a-1] = 1
    q = deque([0])
    ans = {i:-1 for i in range(n)}
    ans[0] = 0
    while True:
        now = q.popleft()
        for i in range(n):
            if arr[now][i] == 0:
                continue
            if ans[i] == -1:
                ans[i] = now
                q.append(i)
        if len(q) == 0:
            break
    print('Yes')
    for i in range(1,n):
        print(ans[i]+1)


if __name__=='__main__':
    main()

### FIXED CODE ###

from collections import deque

def main():
    n,m = map(int,input().split())
    ab = [[] for i in range(n)]
    for _ in range(m):
        a,b = map(int,input().split())
        ab[a-1].append(b-1)
        ab[b-1].append(a-1)
    q = deque()
    q.append(0)
    ans = [-1] * n
    ans[0] = 0
    while q:
        now = q.popleft()
        for i, next in enumerate(ab[now]):
            if ans[next] == -1:
                ans[next] = now+1
                q.append(next)
        if len(q) == 0:
            break
    print('Yes')
    for i in range(1,n):
        print(ans[i])



if __name__=='__main__':
    main()
import math
def I():
  return input()
def II():
  return int(input())
def MII():
  return map(int, input().split())
def LMII():
  return list(map(int, input().split()))
def P(s):
  return print(s)

import math
a, b , h, m = map(int, input().split())
xa = a * math.sin(h/6*math.pi)
ya = a * math.cos(h/6*math.pi)
xb = b * math.sin(m/30*math.pi)
yb = b * math.cos(m/30*math.pi)
print(math.sqrt((xa-xb)**2 + (ya-yb)**2))
a,b = MII()
h,w = MII()
print((a-h)*(b-w))

### FIXED CODE ###

import math
def I():
  return input()
def II():
  return int(input())
def MII():
  return map(int, input().split())
def LMII():
  return list(map(int, input().split()))
def P(s):
  return print(s)

a,b = MII()
h,w=MII()
P((a-h)*(b-w))
import math
K=input()

if K%7==0:
    L=9*K/7
else:
    L=9*K

if L%2==0 or L%5==0:
    print(-1)
else:
    r=10%L
    for i in range(1,10**6+1):
        if r==1:
            ans=i
            break
        else:
            r=10*r%L

print(ans)

### FIXED CODE ###

import math
K=int(input())

if K%7==0:
    L=9*K//7
else:
    L=9*K

if L%2==0 or L%5==0:
    ans=-1
else:
    r=10%L
    for i in range(1,10**6+1):
        if r==1:
            ans=i
            break
        else:
            r=10*r%L
print(ans)
n, q = map(int, input().split())
g = [[] for i in range(n)]
for i in range(n-1):
    a,b = map(int, input().split())
    g[a-1].append(b-1)
    g[b-1].append(a-1)
print(g)
 
val = [0 for i in range(n)]
score = [0 for i in range(n)]
for i in range(q):
    p,x = map(int, input().split())
    val[p-1] +=x
#print(val)
 
def dfs(p, x):
    if g[p]:
        for c in g[p]:
            score[c]+=x
            dfs(c, x)
for i in range(n):
    dfs(i, val[i])
    score[i] +=val[i]
print(*score)

### FIXED CODE ###

import sys
from collections import deque
sys.setrecursionlimit(1000000)

n,q = map(int, input().split())
a_b = [list(map(int, sys.stdin.readline().split())) for _ in range(n-1)]
p_x = [list(map(int, sys.stdin.readline().split())) for _ in range(q)]

v = [deque([]) for i in range(n)]
for e in a_b:
    v[e[0]-1]+=[e[1]-1]
    v[e[1]-1]+=[e[0]-1]
score = [0 for i in range(n)]
for e in p_x:
    score[e[0]-1]+=e[1]
def dfs(p, bp=-1):
    while v[p]:
        c =v[p].popleft()
        if c ==bp:
            continue
        #print(p, c, bp)
        score[c]+=score[p]
        dfs(c, bp=p)
visited = [0]                
dfs(0)
print(*score)
a,b=input(int,inupt.split())
if a<10,b<10:
  print(a*b)
else:
  print("-1")

### FIXED CODE ###

a,b=map(int,input().split())
if a<=9 and b<=9:
  print(a*b)
else:
  print(-1)
# -*- coding:utf-8 -*-
import sys
sys.setrecursionlimit(1000000)

def preDatasets():
	datas = input()
	for i in range(len(datas)):
		datas[i] = datas[i].strip('\n')
	return datas

def dfs(x, y, sym):
	tile[x][y] = '.'
	for i in range(len(DX)):
		nx = x + DX[i]
		ny = y + DY[i]
		if nx>=0 and nx<N and ny>=0 and ny<M and tile[nx][ny]==sym:
			dfs(nx, ny, sym)

def solve():
	res = 0
	for i in range(N):
		for j in range(M):
			if not tile[i][j] == '.':
				if tile[i][j] == '@':
					dfs(i, j, '@')
					res += 1
				elif tile[i][j] == '#':
					dfs(i, j, '#')
					res += 1
				elif tile[i][j] == '*':
					dfs(i, j, '*')
					res += 1
	print(res)

index = 0	
DX = [-1, 0, 1, 0]
DY = [0, -1, 0, 1]
while True:
	datas = preDatasets()
	
	N = int(datas[index].split(' ')[0])
	M = int(datas[index].split(' ')[1])
	tile = [[0 for i in range(N)]for j in range(M)]
	
	for i in range(len(tile)):
		tile[i] = list(datas[index+i+1])

	if N == 0:
		break
	else:
		solve()
		index += N+1

### FIXED CODE ###

# -*- coding:utf-8 -*-
import sys
def dfs(x, y, sym):
	tile[x][y] = "."
	for i in range(len(DX)):
		nx = x + DX[i]
		ny = y + DY[i]
		if (0<=nx and nx<N and 0<=ny and ny<M and tile[nx][ny] is sym):
			dfs(nx, ny, sym)

def solve():
	res = 0
	for i in range(N):
		for j in range(M):
			sym = tile[i][j]
			if tile[i][j] != ".":
				if tile[i][j] is sym:
					dfs(i, j, sym)
					res += 1
	print(res)

counter=0
DX = [-1,0,1,0]
DY = [0,-1,0,1]
sys.setrecursionlimit(10**7)
while True:
	line = input()
	if " " in line:
		nums = line.split(" ")
		N = int(nums[0])
		M = int(nums[1])
		tile = [[0 for i in range(M)] for j in range(N)]
	else:
		tile[counter-1] = list(line)
	if N is 0 and M is 0:
		break
	counter += 1
	if counter-1 is N:
		solve()
		counter = 0
def Frog1():
    import numpy as np
    n = int(input())
    h = list(map(int, input().split()))
    ans = [np.inf for i in range(n)]
    ans[0] = 0
    def dp(ans, h, k):
        if n == k + 1:
            return
        if n != k + 2:
            ans[k + 2] = min(ans[k + 2], ans[k] + abs(h[k + 2] - h[k]))
        ans[k + 1] = min(ans[k + 1], ans[k] + abs(h[k + 1] - h[k]))
        dp(ans, h , k + 1)
    dp(ans, h, 0)
    print(ans[-1])
Frog1()


### FIXED CODE ###

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

dp = [float("inf") for i in range(n)]

dp[0] = 0
for idx, h in enumerate(hl):
    if idx + 2 < n:
        dp[idx+2] = min(dp[idx] + abs(hl[idx] - hl[idx+2]), dp[idx+2])
    if idx+1 < n:
        dp[idx+1] = min(dp[idx] + abs(hl[idx] - hl[idx+1]), dp[idx+1])

print(dp[n-1])
N=int(input())
a=[list(map(int,input().split())) for i in range(N)]
a.sort(key=lambda x: x[2],reverse=True)
ans=[]
for i in range(0,101):
    for j in range(0,101):
        p=a[0][2]+abs(i-a[0][0])+abs(j-a[0][1])
        q=a[1][2]+abs(i-a[1][0])+abs(j-a[1][1])
        if N>2: r=a[2][2]+abs(i-a[2][0])+abs(j-a[2][1])

        if N==2 and p==q: ans.append([i,j,p])
        elif p==q and p==r: ans.append([i,j,p])


for i in range(2,N) :
    if len(ans)==1: break
    for x in ans:
        if x[2]!=a[i][2]+abs(x[0]-a[i][0])+abs(x[1]-a[i][1]):
            ans.remove(x)

print(ans[0][0],ans[0][1],ans[0][2])

### FIXED CODE ###

import sys
N=int(input())
a=[list(map(int,input().split())) for i in range(N)]
a.sort(key=lambda x: x[2],reverse=True)
ans=[]

if a[0][2]==100:
    print(a[0][0],a[0][1],a[0][2])
    sys.exit()



for i in range(0,101):
    for j in range(0,101):
        p=a[0][2]+abs(i-a[0][0])+abs(j-a[0][1])
#       q=a[1][2]+abs(i-a[1][0])+abs(j-a[1][1])
        for k in range(1,N):
            if a[k][2]>0 and a[k][2]+abs(i-a[k][0])+abs(j-a[k][1])!=p : break
            elif a[k][2]==0 and a[k][2]+abs(i-a[k][0])+abs(j-a[k][1])<p : break
            if k==N-1:
                print(i,j,p)
                sys.exit()
import math

N,X = map(int,input().split())
x = list(map(int,input().split()))
if N == 1:
    print(abs(x[0] - X))
else:
    xlen = [abs(x[0]-X)]
    for i in range(N-1):
        xlen.append(x[i+1]- x[i])
    ans = xlen[0]
    for i in range(N-2):
        ans = math.gcd(ans,xlen[i+1])
    print(ans)

### FIXED CODE ###

A,B = map(int,input().split())
if A != 2 and B != 2:
    print('Yes')
else:
    print('No')
while 1:
    t = input()
    if t == '0 ? 0':
        break
    print(int(eval(t)))

### FIXED CODE ###

while 1:
    t = input()
    if '?' in t:
        break
    print(int(eval(t)))
N=int(input())
S=input()
result=0
for i in range(N):
  if [i:i+3]=='ABC':
    result+=1
print(result)


### FIXED CODE ###

N=int(input())
S=input()
result=0
for i in range(N):
  if S[i:i+3]=='ABC':
    result+=1
print(result)
from collections import deque

n = int(input())
s = input()
lCnt = 0
rCnt = 0
stack = deque()
stack.append(s[0])

for i in range(1, len(s)):
    prev = stack.pop()

    if prev == '(' and s[i] == ')':
        continue
    else:
        stack.append(prev)
        stack.append(s[i])

#print(stack)

for i in range(len(stack)):
    if stack[i] == '(':
        lCnt += 1
    else:
        rCnt += 1

s += ')' * lCnt
s = '(' * rCnt + s

print(s)


### FIXED CODE ###

from collections import deque

n = int(input())
s = input()
lCnt = 0
rCnt = 0
stack = deque()
stack.append(s[0])

for i in range(1, len(s)):
#for i in range(0, len(s)):
    if len(stack) == 0:
        stack.append(s[i])
        continue

    prev = stack.pop()

    if prev == '(' and s[i] == ')':
        continue
    else:
        stack.append(prev)
        stack.append(s[i])

#print(stack)

for i in range(len(stack)):
    if stack[i] == '(':
        lCnt += 1
    else:
        rCnt += 1

s += ')' * lCnt
s = '(' * rCnt + s

print(s)
N = int(input())
A = list(map(int,input().split()))
for i in range(0,n-1):
  for j in range(i+1,n):
    if A[i] == A[j]:
      return 'NO'
return 'YES'


### FIXED CODE ###

N = int(input())
A = list(map(int,input().split()))
A.sort()
ans = "YES"
for i in range(1,N):
    if A[i-1] == A[i]:
        ans = "NO"
        break
print(ans)