peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Accepted
a=map(int,input().split())
A=list(a)
B=0
if A[0]==A[1]:
 B+=1
if A[1]==A[2]:
 B+=1
if A[0]==A[2]:
 B+=1
if B==1:
 print("Yes")
else:
 print("No")
# Judge status: Accepted
N= int(input())
A = list(map(int,input().split()))

B = []
for i in range(N):
    B.append(A[i]-(i+1))
#print(B)
b= (sorted(B)[N//2])
#print(b)
ans = 0
for i in range(N):
    ans += abs(B[i]-b)
print(ans)
# Judge status: Accepted
N = int(input())
WW = list(map(int,input().split()))

Wsum = sum(WW)
phalf = 0
ohalf = 0

psum = 0
for i in range(N):
    psum += WW[i]
    if psum > Wsum / 2:
        ohalf = psum
        phalf = psum - WW[i]
        break
        
difp = Wsum - phalf * 2
difo = ohalf - (Wsum - ohalf)

print(min(difp,difo))
# Judge status: Accepted
N,M,X=[int(s) for s in input().split()]
Book=[[int(s) for s in input().split()] for _ in range(N)]
INF=10**7

ans=set()
ans.add(INF)
#深さ優先探索
def DFS(n,cost,Xls):
  if n==N:
    if min(Xls)>=X:
      ans.add(cost)
  else:
    Xnext=[Xls[i]+Book[n][i+1] for i in range(M)]
    DFS(n+1,cost+Book[n][0],Xnext)
    DFS(n+1,cost,Xls)

DFS(0,0,[0 for _ in range(M)])
if min(ans)==INF:
  print(-1)
else:
  print(min(ans))
# Judge status: Accepted
s = sum(list(map(int,input().split())))
if s % 2 == 0:
  print(s//2)
else:
  print('IMPOSSIBLE')
# Judge status: Accepted
def solve():
  s = input()
  n = len(s)
  if n%2 == 1:
    print("No")
  else:
    tmp = "hi"*(n//2)
    if s == tmp:
      print("Yes")
    else:
      print("No")
solve()
# Judge status: Accepted
n = int(input())
h = list(map(int, input().split()))
idx, size = 0, 0
for j in range(1,len(h)):
    if h[j-1] < h[j]:
        idx = j
    size = max(size,j-idx)
print(size)
# Judge status: Wrong Answer
n = int(input())
l = list(map(int, input().split()))

odd, even = [], []

odd = [i for i in l if i % 2 == 1]
even = [j for j in l if j % 2 == 0]

even.reverse()
e_o = even + odd

if n%2 == 1:
    e_o.reverse()
    print(*e_o)
else:
    print(*e_o)
# Judge status: Wrong Answer
#入力
A,B,N=map(lambda x:int(x),input().split())

Max=0
x=1
for x in range(N+1):
	num=int(A*x/B)-A*int(x/B)
	if num>=Max:
		Max=num
	x=x+1
print(Max)
# Judge status: Accepted
import collections


N= int(input())
s = input()
counter = collections.Counter({'R':0, 'W':0})
counter.update(s)
print(s[:counter['R']].count('W'))
# Judge status: Accepted
a=list(map(int,input().split()))
b=sum(a)
 
if (b%3 ==0 or a[0]%3 ==0 or a[1]%3==0) :
  print('Possible')
else :
  print('Impossible')
# Judge status: Accepted
def main():
    n, *s = map(int, open(0).read().split())
    s.sort()
    x = [i for i in s if i % 10 != 0]
    t = sum(s)
    if t % 10 != 0:
        ans = t
    elif len(x) > 0:
        ans = t - x[0]
    else:
        ans = 0

    print(ans)


if __name__ == '__main__':
    main()
# Judge status: Accepted
d=int(input())
s="Christmas"
day=25-d
for i in range(day):
	s+=" Eve"
print(s)
# Judge status: Accepted
from itertools import accumulate

N, M, K = map(int, input().split())
*A, = map(int, input().split())
*B, = map(int, input().split())
cumsum_A, cumsum_B = [0] + list(accumulate(A)), [0] + list(accumulate(B))
ans = 0
j = M
for i in range(N+1):
    if cumsum_A[i] > K: break
    while cumsum_A[i] + cumsum_B[j] > K: j -= 1
    ans = max(ans, i + j)
print(ans)
# Judge status: Accepted
import sys

S = input();
if S == 'ABC':
    print('ARC')
else:
    print('ABC')
# Judge status: Accepted
x, y, z = map(int,input().split())
x, y = y, x
x, z = z, x
print(x, y, z)
# Judge status: Accepted
a, b = map(int, input().split())
ans = 0
for i in range(a, b+1):
    nor = str(i)
    rev = "".join(list(reversed(nor)))
    if nor == rev:
        ans += 1
print(ans)
# Judge status: Wrong Answer
N,K = [int(i) for i in input().split()]
h = [int(i) for i in input().split()]
minToatalCostList = [100000 for i in range(N)]
minToatalCostList[0] = 0

for i in range(1,N) :
	for j in range(1,K+1) :
		if j > i or minToatalCostList[i] == 0 :
			break
		else :
			minToatalCostList[i] = min(minToatalCostList[i], abs(h[i] - h[i-j]) + minToatalCostList[i-j] )

print(minToatalCostList[N-1])
# Judge status: Wrong Answer
n,k=map(int,input().split())

if k==1:
    print(0)
elif n>k:
    print(k-(n%k))
else:
    print(n)
# Judge status: Accepted
i = input()

if i == "0":
    print(1)
else:
    print(0)
# Judge status: Accepted
x=int(input())
ans=0
num=x+100
for i in range(1,33):
    for j in range(2,11):
        a=x-(i**j)
        if a>=0 and num>a:
            ans=x-a
            num=a
print(ans)
# Judge status: Accepted
N, x = map(int, input().split())
a = list(map(int, input().split()))

r1 = sum(a)
flow = 0

for i in range(1, N):
    t = (a[i] + a[i - 1]) - x
    if flow != 0:
        a[i-1] -= flow
        t -= flow
        flow = 0

    if t > 0:
        if t > a[i]:
            t -= a[i]
            a[i - 1] -= t
            t = a[i]

        flow = t

a[-1] -= flow

r2 = sum(a)

print(r1 - r2)
# Judge status: Accepted
N_list = [int(i) for i in list(input())]
N_list = N_list[::-1] + [0]

for index in range(0, len(N_list)):
  if N_list[index] >= 6 or (N_list[index] == 5 and N_list[index+1] >= 5) :
    N_list[index] = 10 - N_list[index]
    N_list[index+1] += 1

print(sum(N_list))
# Judge status: Wrong Answer
n = int(input())
a = list(map(int, input().split()))
b = sorted(a, reverse=True)
ans = 0
for i in range(n):
    ans += b[(i+1)//2]
print(ans)
# Judge status: Accepted
import sys

s = sys.stdin.readline().rstrip()

def main():
    a, b = int(s[:2]), int(s[2:])
    if 1 <= a <= 12:
        if 1 <= b <= 12:
            return 'AMBIGUOUS'
        else:
            return 'MMYY'
    else:
        if 1 <= b <= 12:
            return 'YYMM'
        else:
            return 'NA'

if __name__ == '__main__':
    ans = main()
    print(ans)
# Judge status: Wrong Answer
k, s = 2,2
ans = 0
for x in range(k+1):
    for y in range(k+1):
        if s-x-y >= 0:
            if x+y+(s-x-y) == s:
            	ans += 1
print(ans)
# Judge status: Accepted
N = int(input())
B =list(map(int,input().split()))
A=[0]*N

A[0]=B[0]
for i in range(1,N-1):
    A[i]=min(B[i],B[i-1])
A[-1]=B[-1]
print(sum(A))
# Judge status: Wrong Answer
list = []
list1 = []
list2 = []
list3 = []
list5 = []
list1 = input().split()
list2 = input().split()
list3 = input().split()# separate by whitespace
list.extend(list1)
list.extend(list2)
list.extend(list3)
n = int(input())
a = 1
for i in range(0,n):
    a = (input())
    list5.append(a)
for item in list5:
        for items in list:
            if items==item:
                print('Yes')
                a = 1
            break
if a==1:
    a=1
else:
    print('No')
# Judge status: Accepted
n,x,y=map(int,input().split())
k=[0]*n
for i in range(1,n):
  for j in range(1,n-i+1):
    t=min(j,abs(i-x)+abs(i+j-y)+1)
    k[t]+=1
for i in range(1,n):
  print(k[i])
# Judge status: Accepted
from collections import Counter,defaultdict,deque
from heapq import heappop,heappush
from bisect import bisect_left,bisect_right 
import sys,math,itertools,fractions,pprint
sys.setrecursionlimit(10**8)
mod = 10**9+7
INF = float('inf')
def inp(): return int(sys.stdin.readline())
def inpl(): return list(map(int, sys.stdin.readline().split()))

n = inp()
a = [inp() for _ in range(n)]
res = 0
for i,x in enumerate(a):
    res += x//2
    if x%2:
        if i == n-1 or a[i+1] == 0: continue
        a[i+1] -= 1
        res += 1
print(res)
# Judge status: Wrong Answer
N = int(input())
c0=[]
c1=[]
c2=[]
c3=[]
for i in range(N):
    S = input()
    if S == "AC":
        c0.append(S)
    elif S == "WA":
        c1.append(S)
    elif S == "TLE":
        c2.append(S)
    elif S == "RE":
        c3.append(S)

print("AC","×",len(c0))
print("WA","×",len(c1))
print("TLE","×",len(c2))
print("RE","×",len(c3))
# Judge status: Accepted
n, k=input().split()
l, m= map(int, input().split())
o = input()
if n==o:
	l = l-1
if k == o:
	m = m-1
print(l,m)
# Judge status: Accepted
import itertools
import math

def calc_distance(pos_i, pos_j):
  return math.sqrt((pos_i[0] - pos_j[0]) ** 2 + (pos_i[1] - pos_j[1]) ** 2)

def permutations_count(n, r):
    return math.factorial(n) // math.factorial(n - r)

N = int(input())

pos_dict = {i: list(map(int, input().split())) for i in range(1, N + 1)}

sum_distance = 0
for p in itertools.permutations(range(1, N + 1)):
  for i in range(len(p) - 1):
    sum_distance += calc_distance(pos_dict[p[i]], pos_dict[p[i+1]])

print(sum_distance / permutations_count(N, N))
# Judge status: Accepted
a, b, c, d = map(int, input().split())
i = 0
while a > 0 and c > 0:
  if i%2==0:
    c -= b
  else:
    a -= d
  i+=1
    
if a <= 0:
  print("No")
else:
  print("Yes")
# Judge status: Accepted
nums = [int(i) for i in input().split()]

nums = sorted(nums, reverse=True)
diff_2_3 = nums[1] - nums[2]

if diff_2_3 == 0:
    cnt = 0
else :
    q, r = divmod(diff_2_3, 2)
    cnt = q + r
    if r == 1:
        cnt +=1

cnt += nums[0] - nums[1]

print(cnt)
# Judge status: Wrong Answer
k=int(input())
if k % 2 == 0:
  print(k / 2 * k / 2)
else:
  print(int(k // 2 * (k // 2 + 1)))
# Judge status: Accepted
s = input()
n = len(s)
a, b = (n-1)//2, ((n+3)//2)-1
if s[0:a] == ''.join(reversed(s[0:a])) and s[b:] == ''.join(reversed(s[b:])) and s == ''.join(reversed(s)):
	print("Yes")
else:
	print("No")
# Judge status: Accepted
N = input()

a = 0  # not carried
b = 0  # carried
t = int(N[-1])
a, b = a + t, a + (10 - t)

for i in range(len(N) - 2, -1, -1):
    t = int(N[i])
    a, b = min(a + t, b + (t + 1)), min(a + (10 - t), b + (10 - (t + 1)))
print(min(a, b + 1))
# Judge status: Accepted
n = int(input())
m = 10**9 + 7
print(((10**n) % m - (9**n) % m * 2 + (8**n) % m) % m)
# Judge status: Accepted
def prod(ls):
    def resolve(ls, a):
        if len(ls) == 1:
            return a*ls[0]
        else:
            car = ls[0]
            ls = ls[1:]
            return resolve(ls, a*car)
    return resolve(ls, 1)

ls = list(map(int, input().split()))
if sum(ls) == 17 and prod(ls) == 175:
    print("YES")
else :
    print("NO")
# Judge status: Wrong Answer
N, M = tuple(map(int, input().split()))

import math
def comb(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))

if N < 2 and N < 2:
    print(0)
elif M < 2:
    print(comb(N,2))
elif N < 2:
    print(comb(M,2))
else:
    print(comb(N,2) + comb(M, 2))
# Judge status: Accepted
N = int(input())
a = list(map(int,input().split()))

ans = 1
flags=[False,False]

for i in range(N-1):
  da = a[i+1] - a[i]
  if da > 0:
    flags[0] = True
  elif da < 0:
    flags[1] = True
    
  if all(flags):
    ans += 1
    flags = [False,False]
print(ans)
# Judge status: Wrong Answer
a, b, c, d = map(int, input().split())
if b < 0 and d < 0:
    print(c * a)

elif a > 0 and b > 0:
    print(a * b)

elif b < 0 and d > 0:
    print(c * b)


elif b > 0 and d < 0:
    print(d * a)
# Judge status: Accepted
n,m = map(int,input().split())
L = [list(map(int,input().split())) for _ in range(m)]
G = [[] for _ in range(n)]
for l in L:
    G[l[0]-1].append(l[1]-1)
    G[l[1]-1].append(l[0]-1)
for g in G:
    print(len(g))
# Judge status: Accepted
a,b = input().split()
a = int(a)
b = int(b[0:-3] + b[-2:])
print(a * b // 100)
# Judge status: Wrong Answer
N = int(input())
A = [int(x) for x in input().split()]

cnt = 0
flg_2 = 0
for a in A:
    if a % 4 == 0:
        cnt += 1
    elif a == 2:
        flg_2 += 1
        if flg_2==2:
            N -= 1
            flg_2 = 0
if cnt >= N//2:
    ans = 'Yes'
else:
    ans = 'No'
print(ans)
# Judge status: Wrong Answer
L,R,D = map(int, input().split())

r = [i for i in range(L-1,R+1)]
A = [j for j in range(L-1,R+1)]

N = [k for k in r if k % D == 0]

print(len(N))
# Judge status: Wrong Answer
N = int(input())
A = list(map(int, input().split()))
A = [a//400 for a in A]
l = len({0,1,2,3,4,5,6,7}&set(A))
S = sum(a>7 for a in A)
print(max(l, S), l+S)
# Judge status: Accepted
import math
import sys

stdin = sys.stdin

ns = lambda: stdin.readline().rstrip()
ni = lambda: int(stdin.readline().rstrip())
nm = lambda: map(int, stdin.readline().split())
nl = lambda: list(map(int, stdin.readline().split()))
mod = 10**9 + 7 
sys.setrecursionlimit(1000010)

X,Y,A,B,C=nm()
p = sorted(nl(),reverse=True)
q = sorted(nl(),reverse=True)
r = nl()
u = sorted(p[0:X] + q[0:Y] + r,reverse=True)[0:X+Y]
# print(u)
print(sum(u))
# Judge status: Accepted
n=int(input(""))
a=[]
b=[]
for i in range(n):
    cc=input("").split(" ")
    a+=[int(cc[0])]
    b+=[int(cc[1])]
s=0
a.sort()
b.sort()
if (n%2==0):
    s=(a[int(n/2)]+a[int(n/2)-1]-b[int(n/2)]-b[int(n/2)-1])
else:
    s=a[int((n-1)/2)]-b[int((n-1)/2)]
print(int(-s+1))
# Judge status: Wrong Answer
a=[list(map(int,input().split())) for _ in range(3)]
n=int(input())

for i in range(n):
  b=int(input())
  for j in range(3):
    for k in range(3):
      if a[j][k]==b:
        a[j][k]=0

ans=0
for i in range(3):
  if a[i][0]==0 and a[i][1]==0 and a[i][2]==0:
    ans=1
  elif a[0][i]==0 and a[1][i]==0 and a[2][i]==0:
    ans=1

if a[1][1]==0 and a[2][2]==0 and a[0][0]==0:
  ans=1

if ans==1:
  print('Yes')
else:
  print('No')
# Judge status: Accepted
#!/usr/bin/env python3

import sys
sys.setrecursionlimit(300000)


def solve(H: int):
    ret = 0
    i = 1
    while H > 0:
        ret += i
        i *= 2
        H //= 2
    print(ret)
    return

def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    H = int(next(tokens))  # type: int
    solve(H)

if __name__ == '__main__':
    main()
# Judge status: Accepted
# 数値を取得
N = str(input())

# 文字列を検査し結果を出力
if "9" in N:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
s=input()
u=list(s)
u[3]="8"
k="".join(u)
print(k)
# Judge status: Accepted
import math

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

x = (a + b)/2

xx= math.ceil(x)

print(xx)
# Judge status: Wrong Answer
from bisect import bisect_right
from bisect import bisect_left

N = int(input())
A = sorted(map(int, input().split()))
B = sorted(map(int, input().split()))
C = sorted(map(int, input().split()))
answer = 0
for i in range(N):
    x1 = bisect_left(A, B[i])
    x2 = bisect_right(C, B[i])
    print(x1, x2, N)
    answer += x1 * (N - x2)

print(answer)
# Judge status: Wrong Answer
n,d=map(int,input().split())
cnt=0
for _ in range(n):
  x,y=map(int,input().split())
  
  if (x**2+y**2)>=d**2:
    cnt+=1
print(cnt)
# Judge status: Accepted
ii = lambda:int(input())
mi = lambda:list(map(int,input().split()))
ix = lambda x:list(input() for _ in range(x))
mix = lambda x:list(mi() for _ in range(x))
iix = lambda x:list(int(input()) for _ in range(x))
##########

def resolve():
    h1,m1,h2,m2,k = mi()
    res = convert(h2,m2) - convert(h1,m1) - k
    print(res)

def convert(h,m):
    return h*60 + m

if __name__ == "__main__":
    resolve()
# Judge status: Wrong Answer
A,B=map(int,input().split())

if A-1<=B:
	print(A+B)
else:
	 print(A+(A-1))
# Judge status: Accepted
n, a, b = map(int, input().split())
period = a+b
times = n//period
k = n%period
n =  a if k >a else k
print(times*a + n)
# Judge status: Accepted
N,M,X=map(int,input().split())
C=[]
As=[]
for _ in range(N):
  c,*a=map(int,input().split())
  C+=[c]
  As+=[a]
r=1e9
for i in range(2**N):
  cost=0
  perf=[0]*M
  for j in range(N):
    if (i>>j)&1:
      cost+=C[j]
      perf=[perf[k]+As[j][k] for k in range(M)]
  if all(p>=X for p in perf):
    r=min(r,cost)
if r==1e9:r=-1
print(r)
# Judge status: Wrong Answer
import sys
def main():
    INF=sys.maxsize
    N,K=tuple(map(int,sys.stdin.readline().split()))
    h=tuple(map(int,sys.stdin.readline().split()))
    dp=[INF for _ in range(N)]
    dp[0]=0
    for i in range(N-1):
        for j in range(K+1):
            if i+j<N:dp[i+j]=min([dp[i+j],dp[i]+abs(h[i]-h[i-j])])
    print(dp[N-1])
if __name__=='__main__':main()
# Judge status: Accepted
s = input()
t = input()
ans = 0
for i in range(len(s)):
  if s[i] != t[i]:
    ans += 1
print(ans)
# Judge status: Accepted
from collections import defaultdict
n = int(input())
d = defaultdict(lambda: 0)
for _ in range(n):
    s = list(input())
    s.sort()
    d[''.join(s)] += 1
ans = 0
for v in d.values():
    ans += v*(v-1)//2
print(ans)
# Judge status: Wrong Answer
s=int(input())
count=0
for i in range(10000000):
    if s%2==1:
        s=s*3+1
    else:
        s=s//2
    if s==4:
        count+=1
    if count==2:
        print(i+2)
        break
# Judge status: Accepted
n = int(input())
ab = []
pushCount = 0

for i in range(n):
    ab.append(list(map(int, input().split())))

ans = 0
for i in range(n)[::-1]:
    ab[i][0] += pushCount
    if ab[i][0] % ab[i][1] != 0:
        ans += ab[i][1] - ab[i][0] % ab[i][1]
        pushCount += ab[i][1] - ab[i][0] % ab[i][1]

print(ans)
# Judge status: Accepted
s = int(input())

MOD = 10 ** 9 + 7


fact = [0] * 4400
invfact = [0] * 4400

fact[0] = 1
for i in range(1, 4400):
    fact[i] = fact[i-1] * i % MOD

invfact[4400 - 1] = pow(fact[4400 - 1], MOD - 2, MOD)

for i in range(4400 - 1, 0, -1):
    invfact[i-1] = invfact[i] * i % MOD


def nCk(n, k):
    return fact[n] * invfact[k] * invfact[n-k] % MOD


ans = 0
for n in range(1, s):
    if 3 * n > s:break
    ans += nCk(s - 3*n + n - 1, n-1)
    ans %= MOD
print(ans)
# Judge status: Wrong Answer
mod = (10 ** 9 + 7)

def comb(n, r):
    p, q = 1, 1

    for i in range(r):
        p = p *(n-i)%mod
        q = q *(i+1)%mod

    return (p / q) % mod

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

s = pow(2, n, mod) - 1

print((s - comb(n, a) - comb(n, b)) % mod)
# Judge status: Wrong Answer
N, M = map(int, input().split())
H = list(map(int, input().split()))
AB = [list(map(int, input().split())) for i in range(M)]

cnt = 0

s = set()
used = set()
for i in range(M):
    lef = AB[i][0]-1
    rig = AB[i][1]-1
    if not H[lef] == H[rig]:
        s.add(max(H[lef], H[rig]))
        used.add(H[lef])
        used.add(H[rig])

cnt = len(set(H)) - len(used)
print(len(s)+cnt)
# Judge status: Accepted
n,a,b=map(int,input().split())

s=0
for i in range(1,n+1):
    seqi=str(i)
    sumi=0
    for j in range(len(seqi)):
        sumi+=int(seqi[j])
    if a<=sumi<=b:
        s+=i
print(s)
# Judge status: Wrong Answer
N = int(input())
A = [int(_) for _ in input().split()]

dp = [1000]
K = [0]
C = [0]

for i in range(N):
    k, c = divmod(dp[-1], A[i])
    v = max(dp[-1], K[-1] * A[i] + C[-1])

    K.append(k)
    C.append(c)
    dp.append(v)

print(dp[-1])
# Judge status: Accepted
n = int(input())
a = list(map(int, input().split()))
c_4 = 0
c_2 = 0
for i in range(n):
  if a[i] % 4 == 0:
    c_4 += 1
  elif a[i] % 2 == 0:
    c_2 += 1
if c_4 >= n // 2:
  print('Yes')
elif c_4 * 2 + c_2 >= n:
  print('Yes')
else:
  print('No')
# Judge status: Wrong Answer
n = int(input())
print((1000-n//1000)%1000)
# Judge status: Accepted
N=int(input())
A=list(map(int,input().split()))
B=list(map(int,input().split()))
count=0
for i,b in enumerate(B):
    attack=min(b,A[i]+A[i+1])
    count+=attack
    A[i+1]-=max(0,attack-A[i])
print(count)
# Judge status: Accepted
N=int(input())
A=list(map(int,input().split()))
B=list(map(int,input().split()))
L=[A,B]

S=0
for i in range(N):
    K=sum(L[0][0:i+1])+sum(L[1][i:N])
    S=max(S,K)
print(S)
# Judge status: Accepted
n = int(input())

ans = 0
for i in range(1, n//2 + 1):
    ans += i * (n//i) * (n//i + 1) // 2

ans += (n + n//2 + 1) * (n - n//2) // 2

print(ans)
# Judge status: Wrong Answer
n = int(input())
for i in range(int(n**0.5)+1, 0, -1):
  if n//i == 0 and i <= n//i:
    key = i
    break
print(i+n//i-2)
# Judge status: Accepted
N, T = map(int, input().split())
ans = 1e9
for n in range(N):
    c, t = map(int, input().split())
    if t <= T:
        ans = min(ans, c)
if ans == 1e9:
    print('TLE')
else:
    print(ans)
# Judge status: Accepted
from math import *

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

ans=A[0]

for i in range(1,N):
  ans=gcd(ans,A[i])

print(ans)
# Judge status: Wrong Answer
data = input()

dataa,datab,datac,datad = data.split(' ')

dataa = int(dataa)
datab = int(datab)
datac = int(datac)
datad = int(datad)

length1 = dataa -datab + datab - datac
length2 = dataa - datac

if length2 < datad:
    print('Yes')
elif length1 < datad:
    print('Yes')
else:
    print('No')
# Judge status: Wrong Answer
N = int(input())
A = list(map(int,input().split()))

cnt_2 = 0
cnt_4 = 0
for a in A:
  if a % 4 == 0:
    cnt_4 += 1
  elif a % 2 == 0:
    cnt_2 += 1
    
if N <= cnt_4 * 3:
  print('Yes')
else:
  N -= cnt_4 * 3
  if N % 2 != 0:
    N += 1
  if N <= cnt_2:
    print('Yes')
  else:
    print('No')
# Judge status: Wrong Answer
import collections
n = int(input())
m = [input() for i in range(n)]

check = ["AC","WA","TLE","RE"]
m = m+check


c = collections.Counter(m)

for i,j in c.items():
  print(i+ " x " +str(j-1))
# Judge status: Accepted
n,m=map(int,input().split())
a=sorted(map(int,input().split()))
l=list()
for i in range(m):
    l.append(list(map(int,input().split())))
l.sort(key=lambda x:-x[1])
i=0
for b,c in l:
    for j in range(b):
        if i+j<n and a[i+j]<c:
            a[i+j]=c
        else:
            print(sum(a))
            exit()
    i+=b
print(sum(a))
# Judge status: Accepted
x, y = map(int, input().split())
print(x + y//2 )
# Judge status: Accepted
n = int(input())
for i in range(n, -1, -1):
    temp = i ** 0.5
    if temp == int(temp):
        print(i)
        break
# Judge status: Accepted
n = int(input())
a = []
b = []
for i in range(n):
    p,q = map(int,input().split())
    a.append(p)
    b.append(q)

ab = zip(b,a)
ab = sorted(ab)
b,a = zip(*ab)

val = 0
ans  = "Yes"
for i in range(n):
    val +=a[i]
    if val > b[i]:
        ans = "No"
        break
print(ans)
# Judge status: Wrong Answer
n =  int(input())
sum = 0
for i in range(n):
    if i % 3 == 0 and i % 5 == 0:
        # print('FizzBuzz')
        pass
    elif i % 3 == 0:
        # print('Fizz')
        pass
    elif i % 5 == 0:
        # print('Buzz')
        pass
    else:
        # print(i)
        sum += i

print(sum)
# Judge status: Accepted
N, K = map(int,input().split())
S = input()
a = S[:K-1] + str.lower(S[K-1]) + S[K:]
print(a)
# Judge status: Accepted
s = input()
t = input()
numlist = []
for i in range(len(s)-len(t)+1):
    a = s[i:i+len(t)]
    count = 0
    for j in range(len(t)):
        if a[j] != t[j]:
            count += 1
    numlist.append(count)
print(min(numlist))
# Judge status: Accepted
a, b, c = map(int, input().split())
print('Yes') if a + b >= c else print('No')
# Judge status: Accepted
n,m = map(int,input().split())
ab = []
for i in range(n):
    a,b = map(int,input().split())
    ab.append((a,b))
ab.sort()
yen = 0
cnt = 0
for i, a_b in enumerate(ab):
    if cnt + a_b[1] < m:
        yen += a_b[0] * a_b[1]
        cnt += a_b[1]
    else:
        tmp = m - cnt
        cnt += tmp
        yen += tmp * a_b[0]
print(yen)
# Judge status: Wrong Answer
N=int(input())
A=list(map(int,input().split()))
def linersearch(N,A):
    for i in range(N):
        if A[i]%3==0 or A[i]%5==0:
            return "APPROVED"
    return "DENIED"
linersearch(N,A)
# Judge status: Accepted
N=int(input())
T,A=map(int,input().split())
H=list(map(int,input().split()))
L=[]
P=[]
for i in range(N):
    L.append(abs(A-(T-0.006*H[i])))
P=sorted(L)
print(L.index(P[0])+1)
# Judge status: Wrong Answer
import fractions
a,b,c,d=map(int,input().split())
g=fractions.gcd(c,d)
l=int(c*d/g)
x=b-a
ac=a/c
bc=b/c
ad=a/d
bd=b/d
al=a/l
bl=b/l
if ac==int(ac) or bc==int(bc):
    cans=x//c+1
else:
    cans=x//c
if ad==int(ad) or  bd==int(bd):
    dans=x//d+1
else:
    dans=x//d
if al==int(al) or  bl==int(bl):
    lans=x//l+1
else:
    lans=x//l
        
re=int(x+1-(cans+dans-lans))
print(re)
# Judge status: Wrong Answer
def calord(tmp):
  sumord = ""
  for c in tmp:
    sumord = sumord + str(ord(c))
  return int(sumord)

n, l = map(int, input().split())
l1 = [0]*n
for i in range(n):
  tmp = input()
  sum_ord = calord(tmp)
  l1[i] = (sum_ord, tmp)
l2 = sorted(l1)  
r = ""
for i in range(n):
  r = r + l2[i][1]
  
print(r)
# Judge status: Accepted
N,X,Y=map(int,input().split())
ans=[0]*(N-1)
for i in range(1,N):
	for j in range(i+1,N+1):
		d1=j-i
		d2=abs(X-i)+1+abs(Y-j)
		d=min(d1,d2)
		ans[d-1]+=1
for i in ans:
	print(i)
# Judge status: Accepted
blue = []
red = []
ans = 0
n = int(input())
for i in range(n):
  blue.append(input())
m = int(input())
for j in range(m):
  red.append(input())
word = set(blue)
for k in word:
  c = blue.count(k) - red.count(k)
  ans = max(ans,c)
print(ans)