Harryxun/stf_run huggingface dataset:
X,Y = map(int,input())
if X==Y:
  print(-1)
elif 2*X!=Y:
  print(2*X)
else:
  print(3*X)

### FIXED CODE ###

X,Y = map(int,input().split())
if X%Y==0:
  print(-1)
else:
  print(X)
n,m=map(int,input().split())
mod=10**9+7

    
def fib(j):
    if j==1:
        return 1
    if j==2:
        return 2
    return fib(j-1)+fib(j-2)


ans=1
now=0

for i in range(m):
    a=int(input())
    if a==now:
        ans=0
        break
    if a-1==now:
        now=a+1
        continue
    ans*=fib((a-now-1))
    ans=ans%mod
    now=a+1

ans*=fib((n-now))
ans=ans%mod
print(ans)
    


### FIXED CODE ###

n,m=map(int,input().split())
mod=10**9+7

    
dp=[0]*(n+1)
dp[0]=1

a=set(int(input()) for i in range(m))

for i in range(1,n+1):
    if i in a:
        continue
    x=dp[i-1]
    if i>1:
        x+=dp[i-2]
    dp[i]=x%mod
print(dp[-1])
if __name__ == '__main__':
    hight = int(input()).split()
    print(sorted(num, reverse=True)[i] for i in range(0, 3))



### FIXED CODE ###

num = [int(input()) for i in range(10)]
num.sort(reverse=True)
for i in range(3):
    print(num[i])
sys.setrecursionlimit(100000)

def dfs(i, g, visited):
  visited.add(i)
  for j in g[i]:
    if not (j in visited):
      dfs(j, g, visited)

def main():
  n, m = map(int, input().split())
  p = (list(map(int, input().split())))
  g = [[] for i in range(n + 1)]
  for i in range(m):
    x, y = map(int, input().split())
    g[x].append(y)
    g[y].append(x)
  seen = [False for i in range(n + 1)]
  ans = 0
  for i in range(1, n):
    if not seen[i]:
      visited = set()
      dfs(i, g, visited)
      for j in visited:
        seen[j] = True
        if p[j - 1] in visited:
          ans += 1
  print(ans)

if __name__ == "__main__":
  main()

### FIXED CODE ###

import sys
sys.setrecursionlimit(100000)

def dfs(i, g, visited):
  visited.add(i)
  for j in g[i]:
    if not (j in visited):
      dfs(j, g, visited)

def main():
  n, m = map(int, input().split())
  p = (list(map(int, input().split())))
  g = [[] for i in range(n + 1)]
  for i in range(m):
    x, y = map(int, input().split())
    g[x].append(y)
    g[y].append(x)
  seen = [False for i in range(n + 1)]
  ans = 0
  for i in range(1, n):
    if not seen[i]:
      visited = set()
      dfs(i, g, visited)
      for j in visited:
        seen[j] = True
        if p[j - 1] in visited:
          ans += 1
  print(ans)

if __name__ == "__main__":
  main()
import math
A, B, H, M = = map(int, open(0).split())


arg_b = math.pi * float(M) / 30
arg_a = (math.pi / 6) * (float(H) + float(M)/60) 
K = abs(arg_b - arg_a)
C = math.sqrt(A*A+B*B - 2*A*B*math.cos(K))
print(C)

### FIXED CODE ###

import math
A, B, H, M = map(int, input().split())


arg_b = math.pi * float(M) / 30
arg_a = (math.pi / 6) * (float(H) + float(M)/60) 
K = abs(arg_b - arg_a)
C = math.sqrt(A*A+B*B - 2*A*B*math.cos(K))
print(C)
def main():
    import sys
    def input(): return sys.stdin.readline().rstrip()
    n, k = map(int, input().split())
    a = list(map(int, input().split()))
    mod = 10 ** 9+ 7
    ans = 1

    def answer(a):
        ans =1
        for i in range(k):
            ans *= a[i]
            ans %= mod
        print(ans)

    if n == k:
        answer(a)
        return

    if all([True if x < 0 else False for x in a]) and k%2 == 1:
        a.sort(reverse=True)
        answer(a)
        return

    a.sort(reverse=True, key=lambda x: abs(x))
    flag = 1
    for i in range(k):
        if a[i] < 0:
            flag ^= 1
    if flag or 0 in a[:k]:
        answer(a)
        return
    
    x1, x2, y1, y2 = k-1, k-1, k, k
    while a[x1] >= 0 and x1 >= 0:
        x1 -= 1
    while a[x2] < 0 and x2 >= 0:
        x2 -= 1
    while a[y1] < 0 and y1 < n:
        y1 += 1
    while a[y2] >= 0 and y2 < n:
        y2 += 1

    if x1 == -1 or y1 == n:
        a[x2], a[y2] = a[y2], a[x2]
    
    elif x2 == -1 or y2 == n:
        a[x1], a[y1] = a[y1], a[x1]
    else:
        if a[x1]*a[y2] > a[x2]*a[y1]:
            a[x2], a[y2] = a[y2], a[x2]
        else:
            a[x1], a[y1] = a[y1], a[x1]
    answer(a)
    
    

if __name__ == '__main__':
    main()

### FIXED CODE ###

def main():
    import sys
    def input(): return sys.stdin.readline().rstrip()
    n, k = map(int, input().split())
    a = list(map(int, input().split()))
    mod = 10 ** 9+ 7
    ans = 1

    def answer(a):
        ans =1
        for x in a:
            ans *= x
            ans %= mod
        return ans

    if n == k:
        print(answer(a))
        return
    a.sort(reverse=True, key= lambda x:abs(x))
    if sum(x<0 for x in a[:k])%2 == 0:
        print(answer(a[:k]))
    else:
        if all(x < 0 for x in a):
            print(answer(a[-k:]))
        else:
            try:
                x1, y1= min([x for x in a[:k] if x > 0]), min([x for x in a[k:] if x < 0])
            except ValueError:
                x1, y1 = 1, 0
            try:
                x2, y2= max([x for x in a[:k] if x < 0]),\
                    max([x for x in a[k:] if x >= 0])
            except ValueError:
                x2, y2 = 1, 0
            if abs(x2*y1) > abs(x1*y2):           
                a[a.index(x1)] = y1
            else:
                a[a.index(x2)] = y2
            print(answer(a[:k]))
            


if __name__ == '__main__':
    main()
import itertools

n = int(input())
xy_list = [list(map(int, input().split())) for _ in range(n)]
counts = dict()
for (x1, y1), (x2, y2) in itertools.combinations(xy_list, 2):
    for pq in ((x2 - x1, y2 - y1), (x1 - x2, y1 - y2)):
        counts.setdefault(pq, 0)
        counts[pq] += 1
max_count = max(counts.values())
print(n - max_count)


### FIXED CODE ###

import sys
import itertools

n = int(input())
xy_list = [list(map(int, input().split())) for _ in range(n)]
if n == 1:
    print(1)
    sys.exit()

counts = dict()
for (x1, y1), (x2, y2) in itertools.combinations(xy_list, 2):
    for pq in ((x2 - x1, y2 - y1), (x1 - x2, y1 - y2)):
        counts.setdefault(pq, 0)
        counts[pq] += 1
max_count = max(counts.values())
print(n - max_count)
from sys import stdin
import sys
##  input functions for me
def rsa(sep = ''):
    if sep == '' :
        return input().split() 
    else: return input().split(sep)
def rip(sep = ''):
    if sep == '' :
        return map(int, input().split()) 
    else: return map(int, input().split(sep))
def ria(sep = ''): 
    return list(rip(sep))
def ri(): return int(input())
def rd(): return float(input())
def rs(): return input()
##
import math
def main():
    A, B = rip()
    g = math.gcd(A, B)
    print(A // g * B)
    

if __name__ == "__main__":
    main()


### FIXED CODE ###

from sys import stdin
import sys
import math
import numpy as np
##  input functions for me
def rsa(sep = ''):
    if sep == '' :
        return input().split() 
    else: return input().split(sep)
def rip(sep = ''):
    if sep == '' :
        return map(int, input().split()) 
    else: return map(int, input().split(sep))
def ria(sep = ''): 
    return list(rip(sep))
def ri(): return int(input())
def rd(): return float(input())
def rs(): return input()
##
def main():
    A, B = rip()
    def gcd(a, b):
        return b if a == 0 else gcd(b % a, a)
    g = gcd(A, B)
    print(A // g * B)


if __name__ == "__main__":
    main()
import sys
import math

value = int(sys.stdin.readline())

print round(math.pi * value * value,7), round(2.0 * math.pi * value, 7)

### FIXED CODE ###

import sys
import math

value = float(sys.stdin.readline())

print "%.9f %.9f" % (math.pi * value * value, 2.0 * math.pi * value)
sa = str(input()) + "d"
sb = str(input()) + "d"
sc = str(input()) + "d"
s = sa
sa = sa[1:]
while s != "d":
	x = s[0]
	if x == "a":
		sa = sa[1:]
		s = sa
	elif x == "b":
		sb = sb[1:]
		s = sb
	elif x == "c":
		sc = sc[1:]
		s = sc
if sa == "d":
	print("A")
elif sb == "d":
	print("B")
elif sc == "d":
	print("C")


### FIXED CODE ###

s = {i: list(input()) for i in "abc"}
x = "a"
while s[x]:
    x = s[x].pop(0)
print(x.upper())
n = list(input())
if n.index("9"):
    print("Yes")
else:
    print("No")  

### FIXED CODE ###

n = list(input())
if n[0] == "9" or n[1] == "9":
    print("Yes")
else:
    print("No")
N, S = map(int, input().split())
As = list(map(int, input().split()))
mod = 998244353
import numpy as np
dp = np.array([[0]*(S+1) for i in range(N+1)])
dp[0][0] = 1
for i in range(1, N+1):
    a = As[i-1]
    for s in range(S+1):
        if s-a>=0:
            dp[i][s] += (dp[i-1][s-a] + dp[i-1][s]*2)
        else:
            dp[i][s] += (dp[i-1][s]*2)
    dp[i] %= mod
print(dp[-1][-1]%mod)

### FIXED CODE ###

N, S = map(int, input().split())
As = list(map(int, input().split()))
mod = 998244353
dp = [[0]*(S+1) for i in range(N+1)]
dp[0][0] = 1
for i in range(1, N+1):
    a = As[i-1]
    for s in range(S+1):
        if s-a>=0:
            dp[i][s] += dp[i-1][s-a] + dp[i-1][s]*2
        else:
            dp[i][s] += dp[i-1][s]*2
        dp[i][s] %= mod
print(dp[-1][-1]%mod)
s = input()
for i in range(0, len(s), 2):
  print(s[i], end = '')
s = input()
for i in range(0, len(s), 2):
  print(s[i], end = '')


### FIXED CODE ###

s = str(input())
 
for i in range(len(s)):
    if i % 2 == 0:
        print(s[i], end = '')
n=int(raw_input())
ans=''
for i in range(3,n+1):
    if i%3==0 or '3' in str(i):
        ans+=(' '+str(i))
print ans


### FIXED CODE ###

n=int(raw_input())
ans=''
for i in range(3,n+1):
    if i%3==0 or '3' in str(i):
        ans+=(' '+str(i))
print ans
import bisect
N = int(input())
L = list(map(int,input().split()))
L.sort()
ans =0
for i in range(1,n):
    for j in range(i):
        p = l[i]+ l[j]
        q = bisect.bisect_left(l,p)
        ans += q-i-1

print(ans)

### FIXED CODE ###

import bisect
n = int(input())
l = list(map(int,input().split()))
l.sort()
ans =0
for i in range(1,n):
    for j in range(i):
        p = l[i]+ l[j]
        q = bisect.bisect_left(l,p)
        ans += q-i-1

print(ans)
n, r = map(int, input().split())
if n >= 10:
  print r
else:
  print r + 100 * (10 - n)


### FIXED CODE ###

n, r = map(int, input().split())
if n >= 10:
  print(r)
else:
  print(r + (100 * (10 - n)))
N, Y = map(int, input().split())
 
for x in range(N + 1):
    for y in range(N + 1- x):
        if 10000 * x + 5000 * y + 1000 * (N - x - y) == Y:
            print(x,y,z)
            exit()
print('-1 -1 -1')

### FIXED CODE ###

N, Y = map(int, input().split())
 
for x in range(N + 1):
    for y in range(N + 1- x):
        z=N - x - y
        if 10000 * x + 5000 * y + 1000 * z == Y:
            print(x,y,z)
            exit()
print('-1 -1 -1')
s = int(input())

ans = [s]
 
while True:
  if s%2 ==0:
    s = s//2
  else:
    s = 3s + 1
 
  if s in ans:
        break
  else:
        ans.append(s)

### FIXED CODE ###

s = int(input())
ans = [s]
 
while True:
  if s%2 ==0:
    s = s//2
  else:
    s = 3*s + 1
 
  if s in ans:
        break
  else:
        ans.append(s)
      
print(len(ans)+1)
n = int(input())
s = str(input())
alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
rot = []
for i in s:
  pos = alphabet.find(i)
  pos = int(pos) + n
  if pos > 26:
    pos = int(pos) - 26
  rot.append(alphabet[pos])
strout = "".join(rot)
print(strout)

### FIXED CODE ###

n = int(input())
s = str(input())
alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
rot = []
for i in s:
  pos = alphabet.find(i)
  pos = int(pos) + n
  if pos >= 26:
    pos = int(pos) - 26
  rot.append(alphabet[pos])
strout = "".join(rot)
print(strout)
a=1
while 1:
	l = map(int,raw_input().split())
	if l == [0,0]:
		break
	else :
		print ' '.join(map(str,sorted(l)))
        a += 1

### FIXED CODE ###

a=1
while 1:
	i = int(raw_input())
	if i == 0 :
		break
	else :
		print 'Case %d: %d'%(a, i)
        a += 1
n, k = map(int, input().split())
A = list(map(int, input().split()))
def f(x):
    return A[x-1]
c = 1
P = [1]
 
for i in range(1,k+1):
    c = f(c)
    if c in P:
        roop_start = P.index(c)
        roop_num = i- roop_start
        break
    P.append(c)
a = (k - roop_start) %  roop_num
for i in range(a):
    P[roop_start] = f(P[roop_start])
print(roop_start)

### FIXED CODE ###

n, k = map(int, input().split())
A = list(map(int, input().split()))
now = 1
 
for i in range(len(bin(k))-2):
    if (k>>i)&1:
        now = A[now-1]
    A = [A[a-1] for a in A]
print(now)
n=int(input())
a=[int(i) for i in input().split()]
s=0
for i in range(n-1):
    for j in range(i, n):
        s+=a[i]^a[j]
        s%=s
print(s%1000000007)

### FIXED CODE ###

n = int(input())
a = list(map(int, input().split()))
ans = 0
for i in range(60):
  tmp = sum([1 for j in a if (j>>i)&1])
  ans += tmp*(n-tmp)*(2**i)
  ans %= 10**9+7
print(ans)
import collections
N, K, L = map(int, input().split())
city = [{"road":{"Connected":[],"set":-1,"seen":False},
         "rail":{"Connected":[],"set":-1,"seen":False}} for i in range(N)]

def dfs(graph, v, way, num): #深さ優先探索
    graph[v][way]["seen"] = True
    graph[v][way]["set"] = num
    for next_v in graph[v][way]["Connected"]:
        if graph[next_v][way]["seen"]:
            continue
        dfs(graph, next_v, way, num)

for i in range(K):
    p, q = map(int, input().split())
    city[p-1]["road"]["Connected"].append(q-1)
    city[q-1]["road"]["Connected"].append(p-1)
for i in range(L):
    r, s = map(int, input().split())
    city[r-1]["rail"]["Connected"].append(s-1)
    city[s-1]["rail"]["Connected"].append(r-1)
for X in ["road", "rail"]: #連結成分に分解
    set_index = 0
    for v in range(N):
        if city[v][X]["seen"]:
            continue
        dfs(city, v, X, set_index)
        set_index += 1
List = [(x["road"]["set"],x["rail"]["set"]) for x in city]
counter = collections.Counter(List)
for A in List:
    print(counter[A],end=" ")
        


### FIXED CODE ###

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

def fp(x, parentList): #findParent
    if parentList[x] == x:
        return x
    else:
        parentList[x] = fp(parentList[x], parentList)
        return parentList[x]

#各ノードのparentをリストで表現(連結前は自身がparent)
road = [i for i in range(N)]
rail = [i for i in range(N)]

for _ in range(K):
    p, q = map(int, input().split())
    par_p, par_q = fp(p-1, road), fp(q-1, road) #p, qのparent 
    #連結する際、若い番号をparentとする
    if par_p < par_q:
        road[par_q] = par_p
    else:
        road[par_p] = par_q

#railについても同様
for _ in range(L):
    s, t = map(int, input().split())
    par_s, par_t = fp(s-1, rail), fp(t-1, rail)
    if par_s < par_t:
        rail[par_t] = par_s
    else:
        rail[par_s] = par_t

#連結成分の要素をカウント
cnt = {}
for i in range(N):
    key = (fp(i,road),fp(i,rail))
    if key in cnt:
        cnt[key] += 1
    else:
        cnt[key] = 1
#出力
for i in range(N):
    key = (fp(i,road),fp(i,rail))
    ans = cnt[key]
    print(ans, end=" ")
N = int(input())

if N%2==1:
  print(0)
else:
  ans = 0
  m = 5
  n = 1
  while m<=N:
    c = N//m
    c = c//2
    ans += c
    m *= 5
print(ans)

### FIXED CODE ###

N = int(input())

if N%2==1:
  print(0)
else:
  ans = 0
  m = 5
  n = 1
  while m<=N:
    c = N//m
    c = c//2
    ans += c
    m *= 5
  print(ans)
s = input()
t = input()

LS = len(s)
LT = len(t)

num = LT
for i in range(LT):
  if s[0] == t[i]:
    num = i
    break

if LS == 1:
  if num == LT:
    print("")
  else:
    print (s)
  exit()
    
DP = [[0 if i < num or j != 0 else s[0] for i in range(LT)] for j in range(LS)]
T = [1 if i == num else 0 for i in range(LT)]
for i in range(1, LS):
  ma = DP[i-1][0]
  flag = 0
  for j in range(LT):
    if flag == 1:
      T[j] = 0
    if s[i] == t[j] and T[j] == 0:
      if flag == 0:
        T[j] = 1
        flag = 1   
      ma = DP[i-1][j] + s[i]
    elif len(ma) < len(DP[i-1][j]):
      ma = DP[i-1][j]
    DP[i][j] = ma
print(DP[-1][-1])


### FIXED CODE ###

def main(): 
  s = input()
  t = input()

  LS = len(s)
  LT = len(t)
      
  DP = [[0 for i in range(LT + 1)] for j in range(LS + 1)]
  L = [[0 for i in range(LT)] for j in range(LS)]
  for i in range(LS):
    for j in range(LT):
      a = DP[i+1][j]
      b = DP[i][j+1]
      if max(a, b) == a:
        DP[i+1][j+1] = a
        L[i][j] = 1
      else:
        DP[i+1][j+1] = b
        L[i][j] = 2
        a = b
      if s[i] == t[j]:
        c = DP[i][j] + 1
        if max(a, c) == c:
          DP[i+1][j+1] = c
          L[i][j] = 3       
        
  Ans = ""
  j = LS - 1
  k = LT - 1
  x = DP[LS][LT]
  for i in range(x, 0, -1):
    while True:
      if L[j][k] == 3:
        Ans += t[k]
        j -= 1
        k -= 1
        break
      elif L[j][k] == 2:
        j -= 1
      else:
        k -= 1
  print(Ans[::-1])
main()
N = int(input())
p = list(map(int,input().split()))
 
ans = 0
q =p.sorted(0
 
for i in range(N):
	if p[i] != q[i] :
		ans += 1
 
if ans == 0:
	print('Yes')
elif ans == 2:
  	print('Yes')
else :
	print('No')

### FIXED CODE ###

N = int(input())
p = list(map(int,input().split()))
 
ans = 0
 
for i in range(N):
    if p[i] != (i+1) :
        ans += 1
 
if ans == 0:
    print('YES')
elif ans == 2:
      print('YES')
else :
    print('NO')
N = int(input())
T, A  = map(int, input().split())
hight_list = list(map(int, input().split()))

ans = 10000
ans_ind

for i in range(N):
  temp = T - 0.006 * hight_list[i]
  diff = abs(temp - A)
  if  diff < ans:
    ans = diff
    ans_ind = i
    
print(i+1)
    
  

### FIXED CODE ###

N = int(input())
T, A  = map(int, input().split())
hight_list = list(map(int, input().split()))
 
ans = 10000
ans_ind = 0
 
for i in range(N):
  temp = T - 0.006 * hight_list[i]
  diff = abs(temp - A)
  if  diff < ans:
    ans = diff
    ans_ind = i
    
print(ans_ind+1)
import sys

input = sys.stdin.readline


def f(l, c, s, n):
    if not l:
        if s == n:
            return -1
        return s

    if l[0] != c:
        return f(l[1:], c, s + 1, n)
    return f(l[1:], c + 1, s, n)

def main():
    n = int(input()[:-1])
    l = list(map(int, input()[:-1].split(" ")))

    c = 1
    s = 0
    tmp = 0
    while not l:
        if l[tmp] != c :
            s += 1
        else:
            c += 1
        tmp += 1

    res = s
    if s == n:
        res = -1

    print(f(l, 1, 0, n))

main()

### FIXED CODE ###

import sys

input = sys.stdin.readline

def main():
    n = int(input()[:-1])
    l = list(map(int, input()[:-1].split(" ")))

    c = 1
    s = 0
    tmp = 0
    while l:
        if tmp >= n:
            break
        if l[tmp] != c :
            s += 1
        else:
            c += 1
        tmp += 1

    res = s
    if s == n:
        res = -1

    print(res)

main()
from math import gcd


A, B, C, D = map(int, input().split())
lcm = C * D // gcd(C, D)
print(
    B - B//C - B//D + B//lcm
    - ((A-1) - (A-1)//C - (A-1)//D + (A-1)//lcm)
)

### FIXED CODE ###

from fractions import gcd


A, B, C, D = map(int, input().split())
lcm = C * D // gcd(C, D)
print(
    B - B//C - B//D + B//lcm
    - ((A-1) - (A-1)//C - (A-1)//D + (A-1)//lcm)
)
if __name__ == "__main__":
    bit = list(sys.stdin.readline().rstrip())
    print(2 * min(bit.count("0"), bit.count("1")))

### FIXED CODE ###

"""
# 標準入力取得
## 文字列
 = sys.stdin.readline().rstrip()
 = list(sys.stdin.readline().rstrip())

## 数値
 = int(sys.stdin.readline())
 = map(int, sys.stdin.readline().split())
 = list(map(int, sys.stdin.readline().split()))
 = [list(map(int,list(sys.stdin.readline().split()))) for i in range(h)]  # 二次元配列入力　二次元マップみたいな入力のとき

# 0埋め, 小数点出力桁指定時のときの出力
a = 100
b = 0.987654321
print("{0:06d}-{1:6f}".format(a,b))
000100-0.987654

# 文字列をリストに格納
char_list = list("abcd") # ["a","b","c","d"]
"""

import math
import sys
import itertools
import queue
from fractions import gcd

def lcm(a, b):
    return a * b // gcd(a, b)

mod = 1000000007

if __name__ == "__main__":
    bit = list(sys.stdin.readline().rstrip())
    print(2 * min(bit.count("0"), bit.count("1")))
n = int(raw_input())
p = [0 for i in xrange(0, 101)]
m = [0 for i in xrange(0, 101)] for j in range(0, 101)

for i in xrange(1, n+1):
    p[n-1],p[n] = map(int, raw_input.split())

for k in xrange(2, n+1):
    for i in range(1, n-k+2):
       j = i+k-1
       m[i][j] = float("inf")
       for l in range(i,j):
          m[i][j] =  min(m[i][j], m[i][l]+m[l+1][j]+p[i-1]*p[l]*p[j])

print m[1][n]

### FIXED CODE ###

n = int(raw_input())
p = [0 for i in range(0, 101)]
m = [[0 for i in range(0, 101)] for j in range(0, 101)]

for i in range(1, n+1):
   p[i-1], p[i] = map(int, raw_input().split())
     
for k in range(2, n+1):
   for i in range(1, n-k+2):
      j = i+k-1
      m[i][j] = float("inf")
      for l in range(i, j):
         m[i][j] = min(m[i][j], m[i][l] + m[l+1][j] + p[i-1]*p[l]*p[j])
 
print m[1][n]
n = int(input())
fst = n % 10
snd = n / 10

if (fst == 9) || (snd == 9):
    print("Yes")
elif :
    print("No")

### FIXED CODE ###

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

n = int(input())
fst = n % 10
snd = n // 10

if (fst == 9) | (snd == 9):
    print("Yes")
else :
    print("No")
import math
def main():
    n = int(input())
    h = list(map(int, input().split()))
    # dpテーブル作成,スタート地点のdpテーブルの値は0にする
    dp =[math.inf] * n
    dp[0] = 0
    dp[1] = abs(h[0] - h[1])
    for i in range(2,n):
        dp[i] = min([dp[i], dp[i-1]+abs(h[i-1]-h[i]), dp[i-2]+abs(h[i-2]-h[i])])
    print(dp[n-1])

if __name__ == "__main__":
    main()

### FIXED CODE ###

def main():
    n = int(input())
    h = list(map(int, input().split()))
    # dpテーブル作成,スタート地点のdpテーブルの値は0にする
    dp =[10**5] * n
    dp[0] = 0
    dp[1] = abs(h[0] - h[1])
    for i in range(2,n):
        dp[i] = min([dp[i-1]+abs(h[i-1]-h[i]), dp[i-2]+abs(h[i-2]-h[i])])
    print(dp[n-1])

if __name__ == "__main__":
    main()
n = int(input())
a = list(map(int,input().split()))

S1 = 0
S2 = 0
#S1が奇数番目が正の場合、S2が偶数番目が負の場合
cnt = 0

for i,num in enumerate(a):
    S1 += num
    if i % 2 == 0 and S1 <= 0:
        cnt1 += 1 - S1
        S1 = 1
    if i % 2 != 0 and S1 >= 0:
        cnt1 += 1 + S1
        S1 = -1

    S2 += num
    if i % 2 == 0 and S2 >= 0:
        cnt2 += 1 + S2
        S2 = -1
    if i % 2 != 0 and S2 <= 0:
        cnt2 += 1 - S2
        S2 = 1

print(cnt1 if cnt1 <= cnt2 else cnt2)


### FIXED CODE ###

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

S1 = 0
S2 = 0
#S1が奇数番目が正の場合、S2が偶数番目が負の場合
cnt1 = 0
cnt2 = 0

for i,num in enumerate(a):
    S1 += num
    if i % 2 == 0 and S1 <= 0:
        cnt1 += 1 - S1
        S1 = 1
    if i % 2 != 0 and S1 >= 0:
        cnt1 += 1 + S1
        S1 = -1

    S2 += num
    if i % 2 == 0 and S2 >= 0:
        cnt2 += 1 + S2
        S2 = -1
    if i % 2 != 0 and S2 <= 0:
        cnt2 += 1 - S2
        S2 = 1

print(cnt1 if cnt1 <= cnt2 else cnt2)
N, Q = map(int, input().split())
S = ['0'] + list(input())
C = [0] * len(S)
c = 0
for i in range(1, len(S)):
    if S[i-1] == "A" and S[i] == "C":
        c += 1
    C[i] = c
for _ in range(N):
    l, r = map(int, input().split())
    print(C[r] - C[l])


### FIXED CODE ###

N, Q = map(int, input().split())
S = ['0'] + list(input())
C = [0] * len(S)
c = 0
for i in range(1, len(S)):
    if S[i-1] == "A" and S[i] == "C":
        c += 1
    C[i] = c
for _ in range(Q):
    l, r = map(int, input().split())
    print(C[r] - C[l])
S = input()
N = len(S)
a = S[1:(N-1)/2+1]
b = s[(N+3)/2:]

def kaibun(l):
    for i in range(len(l)):
        if l[i] != l[-i]:
            return(False)
    return(True)

if kaibun(S) & kaibun(a) & kaibun(b):
    print("Yes")
else:
    print("No")
            

### FIXED CODE ###

S = input()
N = len(S)
a = S[0:(N-1)//2]
b = S[(N+3)//2-1:]


def k(a):
    for i in range(len(a)):
        if a[i] != a[len(a)-1-i]:
            return False
    else:
        return True

if k(S) & k(a) & k(b):
    print("Yes")
else:
    print("No")
n,k=[int(x) for x in input().split()]
a=[int(x) for x in input().split()]
 
sol=[]
for i in range(n-1):
  sol.append(a[i+1]-a[i])
sol.append(a[0]-a[n-1]+k)
 
sol.sort()
#unwanted segment of max length removed while printing
print(sum(sol[0:n-1]))

### FIXED CODE ###

k,n=[int(x) for x in input().split()]
a=[int(x) for x in input().split()]
 
sol=[]
for i in range(n-1):
  sol.append(a[i+1]-a[i])
sol.append(a[0]-a[n-1]+k)
 
sol.sort()
print(sum(sol[:n-1]))