Harryxun/stf_run huggingface dataset:
import math
print(2**int(log2(int(input()))))

### FIXED CODE ###

import math
print(2**int(math.log2(int(input()))))
(lambda *_: None)(*map(print,
                       map(eval,
                           map(lambda s: s.replace('/', '//'),
                               iter(input, '0 ? 0')))))

### FIXED CODE ###

from __future__ import division, print_function
from sys import stdin, exit
from operator import add, sub, mul, floordiv
d = {'+': add, '-': sub, '*': mul, '/': floordiv, '?': lambda a,b: exit(0)}
while True:
    a, op, b = stdin.readline().split()
    print(d[op](int(a), int(b)))
all = list(map(int, input().split()))

N = all[0]
Y = all[1]

check = 0
for i in range(N):
    j = 0
    for j in range(N-(i+j)):
        c = (N-(i+j))
        total = 10000*i + 5000*j + 1000*c
        if Y!=total:
            continue
        else:
            yu = i
            hi = j
            no = c
            check += 1
            break
    else:
        continue 
    break

if check==100:
    yu = -1
    hi = -1
    no = -1

print(yu)
print(" ")
print(hi)
print(" ")
print(no)
print(" ")


### FIXED CODE ###

all = list(map(int, input().split()))

N = all[0]
Y = all[1]

yu = -1
hi = -1
no = -1
for i in range(N+1):
    for j in range((N+1)-i):
        c = (N-(i+j))
        total = 10000*i + 5000*j + 1000*c
        if Y==total:
            yu = i
            hi = j
            no = c
            break
        else:
            continue
    else:
        continue 
    break

print(str(yu) + " " + str(hi) + " " + str(no))
a,b,c,x = map(int,[input() for i in range(4)])
count = 0
for i in range(a+1):
    for j in range(b+1):
        for n in range(c+1):
            if t = i*500 + j*100 + n*50 == x:
                count = count + 1
print(count)

### FIXED CODE ###

a, b, c, x = map(int, [input() for i in range(4)])
count = 0
for i in range(a+1):
    for j in range(b+1):
        for k in range(c+1):
            if i*500 + j*100 + k*50 == x:
                count+=1
print(count)
"""
左右一列にN個のマスが並んでいます。
左からi番目のマスの高さはH(i)
あなたは好きなマスに降り立ち、右隣のマスの高さが今居るマスの高さ以下である限り右隣のマスへ移動し続けます。
最大で何回移動できるでしょうか。
"""
 
import numpy as np
 
n = int(input())
h = list(map(int, input().split()))
tmp = []
ans = 0
 
for i in range(n-1):
  if h[i] < h[i+1]:
    tmp.append(1)
  else:
    tmp.append(0)
    
box = []   
for i in tmp:
  if i == 0:
    ans += 1
  else:
    ans = 0
  box.append(ans)
    
# print(ans)
# print(box)
print(max(box))

### FIXED CODE ###

"""
左右一列にN個のマスが並んでいます。
左からi番目のマスの高さはH(i)
あなたは好きなマスに降り立ち、右隣のマスの高さが今居るマスの高さ以下である限り右隣のマスへ移動し続けます。
最大で何回移動できるでしょうか。
"""
 
import numpy as np
 
n = int(input())
h = list(map(int, input().split()))
tmp = []
ans = 0

if n != 1:
  for i in range(n-1):
    if h[i] < h[i+1]:
      tmp.append(1)
    else:
      tmp.append(0)
    
box = []   
for i in tmp:
  if i == 0:
    ans += 1
  else:
    ans = 0
  box.append(ans)
    
# print(ans)
# print(box)

if n != 1:
  rslt = max(box)
else:
  rslt = 0
  
print(rslt)
n,k = map(int,input().split())
st = set([])
for i in range(k):
  x,y = map(int,input().split())
  for z in range(x,y+1):
    st.add(z)
ans = [1]
for i in range(1,n):
  s = 0
  for x in st:
    if i >= x:
      s = s + ans[i-x]
  ans.append(s % 998244353)   
  
print(ans[-1])  
  
  
    
  

### FIXED CODE ###

s = input()
if s[-1] == 's':
  print(s+'es')
else:
  print(s+'s')
N, A = map(int, input().split())
X = list(map(int, input().split()))
x_max = max(X)
dp = [[[0]*(N*x_max+1) for i in range(N+1)] for i in range(N+1)]
dp[0][0][0] = 1

for j in range(1, N+1):
    for k in range(N+1):
        for s in range(N*x_max+1):
            if X[j-1] <= s:
                dp[j][k][s] = dp[j-1][k][s] + dp[j-1][k-1][s-X[j-1]]
            else:
                dp[j][k][s] = dp[j-1][k][s]

ans = 0
for i in range(1, N+1):
    ans += dp[N][i][A*i]

print(ans)

### FIXED CODE ###

N, A = map(int, input().split())
X = list(map(int, input().split()))
x_max = max(X)
Y = [x-A for x in X]

dp = [[0]*(2*N*x_max+1) for i in range(N+1)]
dp[0][N*x_max] = 1

for j in range(N+1):
    for t in range(2*N*x_max+1):
        if j >= 1 and 0 <= t - Y[j-1] <= 2*N*x_max:
            dp[j][t] = dp[j-1][t] + dp[j-1][t-Y[j-1]]
        elif j >= 1:
            dp[j][t] = dp[j-1][t]

print(dp[N][N*x_max]-1)
import math
A,B,C,D = [int(i) for i in input().split()]
def lcm(a,b):
    return a*b/math.gcd(a,b)
lcm = lcm(C,D)
aa = ((B//C)-(1 if A%C != 0 else 0))-(A//C)+1
bb = ((B//D)-(1 if A%D != 0 else 0))-(A//D)+1
ll = ((B//lcm)-(1 if A%lcm != 0 else 0))-(A//lcm)+1
print(int((B-A+1)-(aa+bb-ll)))


### FIXED CODE ###

import math


# 最大公約数gcd,
def gcd(a, b):
    while b:
        a, b = b, a % b
    return a


# 最小公倍数lcm
def lcm(a, b):
    return (a * b) // gcd(a, b)


a, b, c, d = (int(i) for i in input().split())

cd = lcm(c, d)
r = b - a + 1

min_c = a // c + (1 if a % c != 0 else 0)
max_c = b // c
min_d = a // d + (1 if a % d != 0 else 0)
max_d = b // d
min_cd = a // cd + (1 if a % cd != 0 else 0)
max_cd = b // cd

c_num = max_c - min_c + 1
d_num = max_d - min_d + 1
cd_num = max_cd - min_cd + 1

print(r - c_num - d_num + cd_num)
N = int(input())

A = {}
COLOR = [1] * N

for _ in range(N - 1):
  u, v, w = map(int, input().strip().split(' '))
  if u not in A: A[u] = {}
  if v not in A: A[v] = {}
  A[u][v] = w
  A[v][u] = w


def test(key, total_w=0):
  if key not in A:
    return

  COLOR[key - 1] = 0 if total_w % 2 == 0 else 1

  v = A.pop(key)
  for k, w in v.items():
    test(k, w + total_w)


test(1)

for c in COLOR:
  print(c)


### FIXED CODE ###

from collections import deque

N = int(input())

A = {}
COLOR = [1] * N

for _ in range(N - 1):
  u, v, w = map(int, input().strip().split(' '))
  if u not in A: A[u] = {}
  if v not in A: A[v] = {}
  A[u][v] = w
  A[v][u] = w


def test(key, total_w=0):
  if key not in A:
    return

  COLOR[key - 1] = 0 if total_w % 2 == 0 else 1

  v = A.pop(key)
  for k, w in v.items():
    test(k, w + total_w)


queue = deque()
queue.append((1, 0))
current_key = 1

while len(queue) > 0:
  key, w = queue.popleft()
  if key not in A:
    continue

  COLOR[key - 1] = 0 if w % 2 == 0 else 1

  for child in A.pop(key).items():
    if child[0] in A:
      queue.append((child[0], w + child[1]))

for c in COLOR:
  print(c)
k = int(input())
if k %2 == 0:
  print(int(k*k/2/2))
elif k%2 ==1:
  print(int((k/2)*(k//2)/2)


### FIXED CODE ###

k = int(input())
if k %2 == 0:
  print(int(k*k/2/2))
elif k%2 ==1:
  print(int((k//2 + 1)*(k//2)))
N = int(stdin.readline().rstrip())
    Hs = list(map(int, stdin.readline().rstrip().split()))

    # print(Hs)

    count = 0
    ret_count = 0
    prev_val = Hs[-1]

    for H in Hs[:-1][::-1]:
        # print('prev_val: ' + str(prev_val))
        # print('H: ' + str(H))
        # print('ret_count: ' + str(ret_count))
        if prev_val <= H:
            count += 1
        else:
            if ret_count < count:
                ret_count = count
            count = 0
        prev_val = H

    if ret_count < count:
        ret_count = count

    print(ret_count)


### FIXED CODE ###

N = int(input().rstrip())
Hs = list(map(int, input().rstrip().split()))

# print(Hs)

count = 0
ret_count = 0
prev_val = Hs[-1]

for H in Hs[:-1][::-1]:
    # print('prev_val: ' + str(prev_val))
    # print('H: ' + str(H))
    # print('ret_count: ' + str(ret_count))
    if prev_val <= H:
        count += 1
    else:
        if ret_count < count:
            ret_count = count
        count = 0
    prev_val = H

if ret_count < count:
    ret_count = count

print(ret_count)
#a,b=map(int, input().split()) 

for i in range(a):
    if (a-i)*2+(i)*4 == b:
        print('Yes')
        break
if i==a-1:
    print('No')

### FIXED CODE ###

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

for i in range(a+1):
    if (a-i)*2+(i)*4 == b:
        print('Yes')
        break
    if i==a:
        print('No')
n, a, b, c = (int(x) for x in input().split())
while n > 0 and b > 0:
    n -= c
    if n < 0:
        print("No")
        break
    b -= a
    if b < 0:
        print("Yes")
        break



### FIXED CODE ###

n, a = (int(x) for x in input().split())
if n <= a:
    print("unsafe")
else:
    print("safe")
r, g, b = [int(n) for n in input().split()]

if 10*g+b % 4 == 0:
    print('YES')
else:
    print('NO')



### FIXED CODE ###

r, g, b = [int(n) for n in input().split()]

if (10*g+b) % 4 == 0:
    print('YES')
else:
    print('NO')
string = input()

c1 = True
c2 = True
c3 = True

if ("W" in string and not("E" in string) or "E" in string and not("W" in string): c1 = False
    
if ("N" in string and not("S" in string) or "S" in string and not("N" in string): c2 = False

if "N" in string and "S" in string and "E" in string and "W" in string:
    N = string.count("N")
    S = string.count("S")
    W = string.count("W")
    E = string.count("E")
    if not(N/S == W/E or N/S == E/W): c3 = False
    
if c1 and c2 and c3: print("Yes")
else: print("No")

### FIXED CODE ###

string = input()

c1 = True
c2 = True
c3 = True

if ("W" in string and not("E" in string)) or "E" in string and not("W" in string): c1 = False
    
if ("N" in string and not("S" in string)) or "S" in string and not("N" in string): c2 = False

if "N" in string and "S" in string and "E" in string and "W" in string:
    N = string.count("N")
    S = string.count("S")
    W = string.count("W")
    E = string.count("E")
    if not(N/S == W/E or N/S == E/W): c3 = False
    
if c1 and c2 and c3: print("Yes")
else: print("No")
#ABC070C
import math
from functools import reduce
N=int(input())
T=[int(input()) for i in range(N)]
def lcm_base(x, y):
    interium=x/math.gcd(x, y)
    return (interium*y)
print(reduce(lcm_base, T))


### FIXED CODE ###

#ABC070C
import math
from functools import reduce
N=int(input())
T=[int(input()) for i in range(N)]
#def lcm_base(x, y):
#    interium=x//math.gcd(x, y)
#    return (interium*y)
#print(reduce(lcm_base, T))
ans=1
def grcode(x, y):
    if y==0:
        return (x)
    else:
        return grcode(y, x%y)
for i in range(N-1):
    T[i]=T[i]//grcode(T[i],T[i+1])
    T[i+1]=T[i]*T[i+1]
print(T[N-1])
#移動の最小値(高速化問題)
x,k,d = map(int,input().split())
x = abs(x)
if (x//d) >=k:
    ans = x - d*k
y = x-(x//d)*d
elif k- (x//d)%2 != 0:
    ans = y
else:
    ans = y-d
print(abs(ans))

### FIXED CODE ###

#移動の最小値(高速化問題)
x,k,d = map(int,input().split())
x = abs(x)
if (x//d) > k:
    ans = x - d*k
elif (k-(x//d))%2 == 0:
    y = x-(x//d)*d
    ans = y
else:
    y = x-(x//d)*d
    ans = y-d
print(abs(ans))
import sys
input=sys.stdin.buffer.readline
mod=10**9+7
n=int(input())
d={}
z=0
from math import gcd 
for i in range(n):
    x,y=map(int,input().split())
    if x==y==0:z+=1
    else:
        f=gcd(x,y)
        x//=f;y//=f
        if x<0:x*=-1;y*=-1
        if x==0 and y<0:y=-y
        d[(x,y)]+=1 if (x,y)in d else d[(x,y)]=1
ans=1
for (a,s) in d:
    if d[(a,s)]==0:continue
    ng=0
    if (s,-a)in d:ng+=d[(s,-a)];d[(s,-a)]=0
    if (-s,a)in d:ng+=d[(-s,a)];d[(-s,a)]=0
    ans*=(pow(2,d[(a,s)],mod)-1 + pow(2,ng,mod)-1 +1)%mod
    ans%=mod
    d[(a,s)]=0
print((ans+z-1)%mod)

### FIXED CODE ###

mod=10**9+7
n=int(input())
from collections import defaultdict
d=defaultdict(int)#各点の方向ベクトルを管理
z=0#原点にいる際は例外処理したいので別途数える
from math import gcd 
for i in range(n):
    x,y=map(int,input().split())
    if x==y==0:z+=1
    else:
        f=gcd(x,y)
        x//=f;y//=f#非本質な定数倍を削除
        if x<0:x*=-1;y*=-1#偏角は|theta|<=pi/2で十分
        if x==0 and y<0:y=-y
        d[(x,y)]+=1
ans=1
for (a,s) in d:
    if d[(a,s)]==0:continue#すでに数えた
    ng=0
    if (s,-a)in d:ng+=d[(s,-a)];d[(s,-a)]=0
    if (-s,a)in d:ng+=d[(-s,a)];d[(-s,a)]=0
    ans*=(pow(2,d[(a,s)],mod)-1 + pow(2,ng,mod)-1 +1)%mod
    #(a,s)を一本以上使う,ngを((a,s)と直交するもの)を一本以上使う,どちらも使わない
    ans%=mod
    d[(a,s)]=0
print((ans+z-1)%mod)#原点はそれ1つのみでしか使えない　+　1つも使わない例を除外
while True:
     (x, y) = [int(i) for i in input().split()]
     if x == 0:
         break
 
     if x > y:
         a = y
         y = x
         x = a
 
     print(x, y)

### FIXED CODE ###

count = 1
while True:
    x = input().strip()
    if x == '0':
        break
    else:
        print( 'Case %s: %s' % ( count, x))
        count += 1
import itertools
import heapq
import sys
import functools
import operator
import numpy as np
input = sys.stdin.readline
#-------------
n,k = map(int,input().split())
a = list(map(int,input().split()))
#-------------
b = np.abs(a)
b = sorted(a,reverse = True)
b_k = b[k-1] 
a_new = [a[_] for _ in range(len(a)) if np.abs(a)[_] >= b_k]
a_new.sort()
D = [[a_new[i+j-k] for j in range(k)] for i in range(10)]
A = (functools.reduce(operator.mul,D[_]) for _ in range(len(D)))
l_max = max(A)
waru = 10**9 + 7
print(l_max % waru)

### FIXED CODE ###

import sys
 
n, k = map(int, input().split())
a = [int(x) for x in input().split()]
mod = pow(10, 9)+7
zero = 0
plus = []
minus = []
for i in range(n):
  if a[i] == 0:
    zero += 1
  elif a[i] > 0:
    plus.append(a[i])
  else:
    minus.append(a[i])
 
P, M = len(plus), len(minus)
plus.sort(reverse=True)
minus.sort()
ans = 1
if n == k:
  for i in range(n):
    ans *= a[i]
    ans %= mod
elif P+M < k:
  ans = 0
elif P == 0:
  if zero and k%2:
    ans = 0
  else:
    if k%2:
      minus.reverse()
    for i in range(k):
      ans *= minus[i]
      ans %= mod
else:
  q = 0
  if k%2:
    ans *= plus[0]
    ans %= mod
    q = 1
  judge = []
  for i in range((len(plus)-q)//2):
    judge.append(plus[2*i+q]*plus[2*i+q+1])
  for i in range(len(minus)//2):
    judge.append(minus[2*i]*minus[2*i+1])
  judge.sort(reverse=True)
  for i in range(k//2):
    ans *= (judge[i]%mod)
    ans %= mod
 
print(ans)
from collections import Counter

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

p = []
l = []
for k, v in A.items():
    if v >= 4:
        p.append(k)
    if v >= 2:
        l.append(k)
if len(l) >= 2:
    p.sort()
    l.sort()
    print(max(l[-1] * l[-2], p[-1]**2))
else:
    print(0)

### FIXED CODE ###

from collections import Counter

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

p = []
l = []
for k, v in A.items():
    if v >= 4:
        p.append(k)
    if v >= 2:
        l.append(k)

ans = 0
if len(p) >= 1:
    p.sort()
    ans = p[-1]**2
if len(l) >= 2:
    l.sort()
    ans = max(l[-1] * l[-2], ans)
print(ans)
import sys
n,m=map(int,input().split())
if m==0:
    x=1
    y=2
    for i in range(n-2):
        if x<y:
            x+=y%1000000007
        else:
            y+=x%1000000007
    print(max(x%1000000007,y%1000000007))
    sys.exit()
a=list(int(input()) for i in range (m))

x=['']*n
if a[0]==1:
    x[0]=0
else:
    x[0]=1

if m>=2:
	if a[0]!=2 and a[1]!=2:
		x[1]=x[0]+1
    

else:
    if a[0]!=2:
	       x[1]=x[0]+1
    elif a[0]==2:
        x[1]=0


for z in range(m):
    x[a[z]-1]=0
        
if n>=4:
    for k in range(2,n):
        if x[k]!=0:
            x[k]=x[k-2]%1000000007+x[k-1]%1000000007
            
else:
    x[2]=x[1]+x[0]
print(x[n-1]%1000000007)

### FIXED CODE ###

import sys

n,m=map(int,input().split())
broken=set(map(int,sys.stdin))

if n==1:
  print (1)
  sys.exit()
if n==2:
  if 1 not in broken and 2 not in broken:
    print (2)
  elif 2 in broken:
    print(0)
  elif 1 in broken and 2 not in broken:
    print(1)
  sys.exit()

way = [0]*n
if 1 not in broken:
  way[0]=1
if 1 not in broken and 2 not in broken:
  way[1]=2
elif 1 in broken and 2 not in broken:
  way[1]=1
for i in range(2,n):
  if i+1 in broken:
    way[i]=0
    continue
  way[i]=(way[i-1]+way[i-2])%1000000007
print(way[n-1])
N, K = map(int, input().split())
mod = 1000000007 

def dfs(K, graph, now, source):
  if source == -1:
    can_use_color_num = K - 1
  else:
    can_use_color_num = K - 2
  if len(graph[now]) > K:
    return 0
  else:
    case_num = 1
    for dst in graph[now]:
      if dst == source:
        continue
      case_num *= can_use_color_num
      can_use_color_num -= 1
      case_num %= mod
    for dst in graph[now]:
      if dst == source:
        continue
      case_num *= dfs(K, graph, dst, now)
      case_num %= mod
    return case_num
  

graph = [[] for i in range(N)]
for i in range(N - 1):
  a, b = map(lambda x:int(x)-1, input().split())
  graph[a].append(b)
  graph[b].append(a)

answer = K * dfs(K, graph, 0, -1)
answer %= mod
print(answer)

### FIXED CODE ###

import sys

sys.setrecursionlimit(10**9)


N, K = map(int, input().split())
mod = 1000000007 

def dfs(K, graph, now, source):
  if source == -1:
    can_use_color_num = K - 1
  else:
    can_use_color_num = K - 2
  if len(graph[now]) > K:
    return 0
  else:
    case_num = 1
    for dst in graph[now]:
      if dst == source:
        continue
      case_num *= can_use_color_num
      can_use_color_num -= 1
      case_num %= mod
    for dst in graph[now]:
      if dst == source:
        continue
      case_num *= dfs(K, graph, dst, now)
      case_num %= mod
    return case_num
  

graph = [[] for i in range(N)]
for i in range(N - 1):
  a, b = map(lambda x:int(x)-1, input().split())
  graph[a].append(b)
  graph[b].append(a)

answer = K * dfs(K, graph, 0, -1)
answer %= mod
print(answer)
words = []
for inp in range(N):
	words.append(input())

frst = words[0]
for i in range(1,len(words)):
	if words[i-1][-1] != words[i][0]:
		print("No")
		break
	else:
		flag = 0
		if words[i] in words[:i-1]:
			print("No")
			break
		else:
			flag = 1
if flag == 1:
	print("Yes")  

### FIXED CODE ###

N = int(input())
words = []
for inp in range(N):
	words.append(input())

frst = words[0]
wrds = set(words)
if len(wrds) != len(words):
	print("No")
else:	
	for i in range(1,len(words)):
		flag = 1
		if words[i-1][-1] != words[i][0]:
			print("No")
			flag = 0
			break
	if flag == 1:
		print("Yes")
n, m = map(int, input().split())
a = sorted(list(map(int, input().split())), reverse=True)
s = a[0]
t = 0
j = 1
ret = 0
for i in range(n):
    s -= a[i]
    ret += a[i] * 2
    m -= 1
    while j < n and (i >= n - 1 or a[i + 1] + a[i + 1] <= a[i] + a[j]):
        if m < i * 2:
            for k in range(i):
                if m > 0:
                    ret += a[j] + a[k]
                    m -= 1
                if m > 0:
                    ret += a[j] + a[k]
                    m -= 1
        else:
            ret += a[j] * i * 2 + t * 2
            m -= i * 2
        s += a[j]
        j += 1
    num = (j - i - 1) * 2
    if m <= num:
        for k in range(i + 1, j):
            if m > 0:
                ret += a[i] + a[k]
                m -= 1
            if m > 0:
                ret += a[i] + a[k]
                m -= 1
        break
    m -= num
    ret += s * 2 + a[i] * num
    t += a[i]
    print(a, m, num, s, i, j, ret)
print(ret)


### FIXED CODE ###

n, m = map(int, input().split())
a = sorted(list(map(int, input().split())), reverse=True)
s = [0]
for ai in a:
    s.append(ai + s[-1])

def count(x, accum=False):
    ret = 0
    for ai in a:
        lo, hi = -1, n
        while hi - lo > 1:
            mid = (lo + hi) // 2
            if ai + a[mid] >= x:
                lo = mid
            else:
                hi = mid
        ret += ai * hi + s[hi] if accum else hi
    return ret

lo, hi = 0, 1000000000
while hi - lo > 1:
    mid = (lo + hi) // 2
    if count(mid) >= m:
        lo = mid
    else:
        hi = mid

print(count(lo, accum=True) - (count(lo) - m) * lo)
fruits = []
minimumValue = -1

def processValue(array:list):
	global minimumValue
	value = 0
	for i in array:
		value += fruits[i]
	
	if minimumValue == -1 or value < minimumValue:
		minimumValue = value

def combi(n,k,i,array):
	if i == k:
		processValue(array)
		return
	for j in range(array[i-1],n):
		if j in array[0:i]:
			continue
		array[i] = j
		combi(n,k,i+1,array)

n,k = map(int,input().split())
fruits = [int(f) for f in input().split()]
combi(n,k,0,[0 for _ in range(k)])
print(minimumValue)


### FIXED CODE ###

def addAndDeleteMin():
	global ans
	global p
	minv = min(p)
	ans += minv
	p.remove(minv)

n,k = map(int,input().split())
p = [int(x) for x in input().split()]
ans = 0
for i in range(k):
	addAndDeleteMin()
print(ans)
b=0
s=list(map(int, input().split()))
if s[0]==s[1]:
    print(2*s[0])
    b=1
elif s[0]>s[1]:
    a=s[0]
    s[0]=s[0]-1
else:
    a=s[1]
    s[1]=s[1]-1
if s[0]==s[1]:
    a=a+s[0]
elif s[0]>s[1]:
    a=a+s[0]
else:
    a=a+s[1]
if b==0:
    print(a)
    

### FIXED CODE ###

a=0
b=0
s=list(map(int, input().split()))
if s[0]==s[1]:
    print(2*s[0])
    b=1
elif s[0]>s[1]:
    a=s[0]
    s[0]=s[0]-1
else:
    a=s[1]
    s[1]=s[1]-1
if s[0]==s[1]:
    a=a+s[0]
elif s[0]>s[1]:
    a=a+s[0]
else:
    a=a+s[1]
if b==0:
    print(a)
n,k=map(int,input().split())
a=[]

for i in range(1,n+1):
  x=0
  while i*(2**x)<k:
    x+=1
    a.append(x+1)
    
ans=0
for j in range(0,n):
  ans+=(1/n)*(2**(-a[j]))
  
print(ans)  
    
  


### FIXED CODE ###

n,k=map(int,input().split())
a=[]

for i in range(1,n+1):
  x=0
  while i*(2**x)<k:
    x+=1
  a.append(x)
    
ans=0
for j in range(0,n):
  ans+=(1/n)*(2**(-a[j]))
  
print(ans)
import numpy as np
a = int(input())
sum = 0
for i in range(a):
  b = int(input())
  sum += b
np.reciprocal(sum)
np.reciprocal(sum)
print(sum)

### FIXED CODE ###

N = int(input())
A = list(map(int, input().split()))
sam = 0
for i in range(N):
  sam += A[i]**-1
print(sam**-1)
def main():
    X, Y = map(int, input().split())

    if X > Y:
        print('>')
    elif X < Y:
        print('<')
    else:
        print('=')

main()


### FIXED CODE ###

def main():
    X, Y = input().split()

    if X > Y:
        print('>')
    elif X < Y:
        print('<')
    else:
        print('=')

main()
n=int(input())
print("ABC"+int(n))

### FIXED CODE ###

n = input()
print("ABC"+n)
n = int(input())
a = list(map(int, input().split()))

x = max(a)
m = x/2
a.remove(x)
a.sort()
ans = 10000
for i in a:
    y = abs(i - m)
    if ans >= y:
        ans = y
    else:
        break    
    z = i
      
print(x, z)

### FIXED CODE ###

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

x = max(a)
m = x/2
a.remove(x)
a.sort()
ans = x

for i in a:
    y = abs(i - m)
    if ans >= y:
        ans = y
    else:
        break    
    z = i
      
print(x, z)
N = int(input())
print(int(N * (N + 1) / 2)

### FIXED CODE ###

N = int(input())
print(int(N * (N + 1) / 2))
a,b=map(int,input().split())
c,d=map(int,input().split())
play_day=a-(c+d)
if play_day>=0:
    print(play_day)
else:
    print("-1")

### FIXED CODE ###

a,b=map(int,input().split())
C=list(map(int,input().split()))
play_day=a-sum(C)
if play_day>=0:
    print(play_day)
else:
    print("-1")
n = int(input())
s = input()
lef2 = s.rindex(")")
rit2 = s.index("(")

ans = s
ans += ")"*(n-(lef2+1))
ans = "("*rit2 + ans
lef = ans.count("(")
rit = ans.count(")")
if lef > rit:
	ans += ")"*(lef-rit)
	print (ans)
elif lef == rit:
	print (ans)
else:
	ans = "("*(rit-lef) + ans
	print (ans)

### FIXED CODE ###

n = int(input())
s = input()
ans = s

let = 0
let2 = ""
for i in range(n):
	if s[i] == "(":
		let += 1
	else:
		if let > 0:
			let -= 1
		else:
			let2 += "("
print (let2 + s + ")"*let)
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 and 2000=>z=>0:
      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-x+1):
        z=N-x-y
        if 0<=z<=2000 and 10000*x+5000*y+1000*z==Y:
            print(x,y,z)
            exit()
print(-1,-1,-1)
import numpy as np

N, M = list(map(int, input().split(" ")))
A_list = np.sort(np.asarray(list(map(int, input().split(" ")))))[::-1]
B_list = np.sort(np.asarray(list(map(int, input().split(" ")))))[::-1]

out = 1
a_next_i = 0
b_next_i = 0
for x in range(N*M, 1, -1):
    cond1 = a_next_i < N and x == A_list[a_next_i]
    cond2 = b_next_i < M and x == B_list[b_next_i]
    if cond1 and cond2:
        kosuu = 1
        a_next_i += 1
        b_next_i += 1
    elif cond1:
        kosuu = b_next_i
        a_next_i += 1
    elif cond2:
        kosuu = a_next_i
        b_next_i += 1
    else:
        kosuu = a_next_i * b_next_i - (N * M - x)
    out *= kosuu
    out = out % 1000000007
   
print(out)

### FIXED CODE ###

inp = sorted(list(map(int, input().split(" "))))

s = [1, 4, 7, 9]

if inp == s:
    print("YES")
else:
    print("NO")