peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Accepted
import sys
import heapq
import math
import fractions
import bisect
import itertools
from collections import Counter
from collections import deque
from operator import itemgetter
def input(): return sys.stdin.readline().strip()
def mp(): return map(int,input().split())
def lmp(): return list(map(int,input().split()))

n=int(input())
p=lmp()
ans=0
m=2*n
for i in range(n):
    if p[i]<=m:
        ans+=1
        m=p[i]
print(ans)
# Judge status: Wrong Answer
import fractions
a, b = map(int, input().split())
common_num = fractions.gcd(a, b)

ans = 1
for i in range(2,int(common_num**0.5)+2):
  if common_num % i == 0:
    ans += 1
    while common_num % i == 0:
      common_num //= i

print(ans)
# Judge status: Accepted
import heapq

k, n = map(int, input().split())
a = [int(x) for x in input().split()]
qa = []
heapq.heapify(qa)

for x in range(len(a) - 1):
    heapq.heappush(qa, abs(a[x] - a[x + 1]))
heapq.heappush(qa, k - a[-1] + a[0])

dis = 0
for x in range(len(qa) - 1):
    dis += heapq.heappop(qa)

print(dis)
# Judge status: Accepted
a,b=map(int,input().split())
n=0
for i in range(1,(b-a)+1):
    n+=i
print(n-b)
# Judge status: Accepted
N,K=map(int,input().split())
h=list(map(int,input().split()))
cost=[0,abs(h[1]-h[0])]

for i in range(2,N):
    cand=10**10
    for j in range(K):
        if j==i:
            break
        cand=min(cand,cost[i-j-1]+abs(h[i]-h[i-j-1]))
    cost.append(cand)
print(cost[-1])
# Judge status: Wrong Answer
n = sorted((map(int,input().split())))
ans = 0
while 1:
  ans += 1
  if n[2]-n[0] > 1:
    n[0] += 2
  else:
    n[0] += 1
    n[1] += 1
  n = sorted(n)
  if n[0]==n[1] and n[1]==n[2]:
    break
print(ans)
# Judge status: Accepted
k=int(input())
s=input()
if len(s)<=k:
    print(s)
else:
    print(s[:k]+"...")
# Judge status: Wrong Answer
l = input().split(" ")
j = input().split(" ")
k = int(l[0])
n = int(l[1])
x = 0
for i in range(n-1):
  d = int(j[i+1]) - int(j[i])
  x = max(x,d)
dt = k - int(x)
print(dt)
# Judge status: Accepted
cubic= list(map(int, input().split()))
cubic.sort()
if cubic[2] % 2 == 0:
    print(0)
else:
    print(cubic[0]*cubic[1])
# Judge status: Accepted
S = list(input())
ans = ""

for s in S:
    if s == "B":
        ans = ans[:len(ans) - 1]
    else:
        ans += s
        
print(ans)
# Judge status: Accepted
alphabet = list("abcdefghijklmnopqrstuvwxyz")
s = list(input())
S = [alphabet.index(x) for x in s]
K = int(input())
tmp = K
i = 0
while i < len(S) and tmp > 0:
  if S[i] != 0 and 26-S[i] <= tmp:
    tmp -= 26-S[i]
    S[i] = 0
  i += 1
if tmp > 0:
  S[-1] = (S[-1]+tmp)%26
print("".join([alphabet[x] for x in S]))
# Judge status: Accepted
from operator import itemgetter

n = int(input())
a = []
for i in range(n):
    s, p = input().split()
    a.append((i + 1, s, -int(p)))
a.sort(key=itemgetter(1, 2))
for i, _, _ in a:
    print(i)
# Judge status: Wrong Answer
import math
import fractions

def divisors(n):
    s = set()
    for x in range(2, math.ceil(n ** 0.5) + 1):
        while n % x == 0:
            s.add(x)
            n //= x
    return s

a, b = map(int, input().split())
print(len(divisors(fractions.gcd(a, b))) + 1)
# Judge status: Accepted
N,M=map(int, input().split())
ans=0
if min(N,M)==1:
    if max(N,M)==1:
        print(1)
        exit()
    print(max(0,max(N,M)-2))
    exit()
ans=(N-2)*(M-2)
print(ans)
# Judge status: Wrong Answer
n=int(input())
hl=list(map(int,input().split()))
count=0
temp_count=0
for i in range(n-1):
    if hl[i]>=hl[i+1]:
        temp_count+=1
    else:
        if count<temp_count:
          count=temp_count
          temp_count=0
if count<temp_count:
    count=temp_count
print(count)
# Judge status: Wrong Answer
a,b,c=list(map(int,input().split()))
 
if a-b>0:
  print('delicious')
  
elif -b+c<=a:
  print('safe')
  
else:
  print('dangerous')
# Judge status: Wrong Answer
N=int(input())
S=input()

import collections
c=collections.Counter(list(S))
c=list(c.values())

rgb=1
for i in range(len(c)):
    rgb*=c[i]
cnt=0

for i in range(N):
    for j in range(i+1,N):
        k=j+j-i
        if k>=N:
            break
        if S[i]!=S[j] and S[j]!=S[k] and S[k]!=S[i]:
            cnt+=1

print(rgb-cnt)
# Judge status: Accepted
if __name__ == "__main__":
    h, w = map(int, input().split())

    if h == 1 or w == 1:
        print(1)
    elif h % 2 == 0 or w % 2 == 0:
        print(h * w // 2)
    else:
        print((h*w+1) // 2)
# Judge status: Accepted
import collections

N = int(input())

a = []
b = []
for i in range(N):
    s = input()
    a.append(s)

M = int(input())
for i in range(M):
    t = input()
    b.append(t)

a1 = collections.Counter(a)
a2 = a1.most_common()

ans = 0
for i in range(len(a1)):
    total = a2[i][1] - b.count(a2[i][0])
    if total > ans:
        ans = total
    else:
        continue
print(ans)
# Judge status: Accepted
ans = 1
x,y = [int(x) for x in input().split()]
while True:
  if x*(2**ans) > y:
    break
  ans += 1
print(ans)
# Judge status: Accepted
N, C, K = list(map(int, input().split()))
T = []
for i in range(N):
  T.append(int(input()))

bus = []
departure=0

T.sort()

for passenger in T:
  if bus == []:
    bus.append(passenger)
    
  elif passenger <= bus[0]+K and len(bus)<=(C-1):
    bus.append(passenger)
  
  else:
    bus.clear()
    departure+=1
    bus.append(passenger)
    
if bus != []:
  print(departure + 1)
else:
  print(departure)
# Judge status: Wrong Answer
import math
N = int(input())
A = list(map(int,input().split()))
l = list()
ll = list()
lll = list()
for i in range(len(A)):
  if A[i]%4 == 0:
    l.append(A[i])
  if A[i]%2 == 0:
    ll.append(A[i])
  if A[i]%2 != 0:
    lll.append(A[i])
four = len(l)
two = len(ll)-four
zero = N-two
a = N/2
b = A.count(0)

if a <= four and b == 0:
  print("Yes")
elif a-two <= four:
  print("Yes")
else:
  print("No")
# Judge status: Wrong Answer
s = input()
if len(s) / 2 == 0:
    print("No")
    exit()

def check(i):
    if len(i) / 2 != 0:
        i2 = i[len(i) // 2 + 1:len(i)]
    else:
        i2 = i[len(i) // 2:len(i)]
    if i[0:len(i) // 2] == i2[::-1] or len(i2) == 1:
        return(True)
    return(False)

s2 = s[0:(len(s) - 1) // 2]
s3 = s[(len(s) - 1) // 2 + 1:len(s)]

if check(s) == True and check(s2) == True and check(s3) == True:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
n = int(input())
H = list(map(int, input().split()))

i = -1
for _ in range(n - 1):
    if H[i - 1] - H[i] > 1:
        ans = "No"
        print(ans)
        exit()
    elif H[i - 1] - H[i] == 1:
        H[i - 1] -= 1
    i -= 1

ans = "Yes"
print(ans)
# Judge status: Wrong Answer
n = int(input())
a = [int(input()) for i in range(n)]
ans = 0
sa = list(set(a))
for i in range(len(sa)):
  if a.count(sa[i]) % 2 == 1:
    ans += a.count(sa[i])
print(ans)
# Judge status: Accepted
x,y=map(int, input().split())

if x<=y:
    if abs(x)<=abs(y):
        ans=min(y-x, y-(-x)+1)
    else:
        ans=min(y-x, 1+abs(-y-x))

else:
    #xの方が大きい
    ans=1+abs(abs(x)-abs(y))
    if x*y>0:
        ans+=1
print(ans)
# Judge status: Wrong Answer
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)

N = ni()
H  = nl()

current = 0
ans = 0
for i in range(1,N):
    if H[i-1] >= H[i]:
       current +=1
    else:
        if current > ans: 
            ans = current
        currrent = 0

if current > ans:
    ans = current
print(ans)
# Judge status: Accepted
S=input()
if int(S[5:7])<=4:
  print('Heisei')
else:
  print('TBD')
# Judge status: Accepted
s = input()
c = s[-1]
if c == '3':
  print('bon')
elif c in ['0','1','6','8']:
  print('pon')
else:
  print('hon')
# Judge status: Accepted
import itertools
Antennas = []
for i in range(5):
    Antennas.append(int(input()))
    
K = int(input())

combi = list(itertools.combinations(Antennas, 2))

flag = True
for c in combi:
    if abs(c[0]-c[1]) > K:
        flag = False

if flag:
    print('Yay!')
else :
    print(':(')
# Judge status: Accepted
n,*aa = map(int, open(0).read().split())

odd = sum([a%2 for a in aa])
quad = sum([a%4==0 for a in aa])

if odd <= quad or (odd == quad + 1 and odd+quad == len(aa)):
    print('Yes')
else:
    print('No')
# Judge status: Accepted
a, v = list(map(int, input().strip().split()))
b, w = list(map(int, input().strip().split()))
t = int(input())

if a == b: print("YES")
else:
    if w >= v: print("NO")
    else:
        tt = abs(a-b)/(v-w)
        
        if tt <= t: print("YES")
        else: print("NO")
# Judge status: Wrong Answer
import sys
input=sys.stdin.readline
from bisect import bisect_right
import itertools

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

A.sort()
Acum = list(itertools.accumulate(A))
print(Acum)
answer = bisect_right(Acum,X)
if answer == N:
    if Acum[-1] < X:
        answer -= 1
print(answer)
# Judge status: Accepted
n=int(input())
w=list(map(int,input().split()))
ans=float('inf')
for i in range(1,len(w)):
  sabun=abs(sum(w[:i])-sum(w[i:]))
  ans=min(ans,sabun)
print(ans)
# Judge status: Wrong Answer
a,b=map(int,input().split())
if a*500 > b:
    print('Yes')
else:
    print('No')
# Judge status: Wrong Answer
import math
a, b, x = map(int, input().split())
if a**2*b/2 >= 2*x:
    c = (2*x)/(a*b)
    print(math.degrees(math.atan2(b, c)))
else:
    d = 2*(b-x/(a**2))
    print(math.degrees(math.atan2(d, a)))
# Judge status: Wrong Answer
N = int(input())
A = list(map(int, input().split()))
ans = 0

for i, a in enumerate(A):
    if (i + a) % 2 == 1:
        ans += 1
print(ans)
# Judge status: Wrong Answer
N = int(input())
A = int(input())
n=N%500
s=False
for i in range(1,A+1):
    if n==i:
        s=True
        break
        
if s:
    print('Yes')
else:
    print('No')
# Judge status: Accepted
n, k, s = map(int, input().split())
if k == n:
    print(" ".join([str(s) for _ in range(n)]))
    exit()

arr = []
for i in range(1, n + 1):
    if i <= k:
        arr.append(s)
    else:
        arr.append(8 ** 9 + 14499)  # テキトー
print(" ".join(list(map(str, arr))))
# Judge status: Wrong Answer
n = int(input())
a = map(int, input().split())
count2 = 0
count4multiple = 0
for i in a:
    if i == 2:
        count2 += 1
    elif i % 4 == 0:
        count4multiple += 1
if n-1 <= count4multiple * 2 + max(0, count2 - 1):
    print("Yes")
else:
    print("No")
# Judge status: Accepted
# AtCoder Grand Contest 006
# A - Prefix and Suffix

def f(word,N,S,T):
    if word[:N]==S and word[-N:]==T:
        return True
    else :
        return False


N=int(input())
S=input()
T=input()

ans = N*2

for i in range (N):
    t=T[N-i:]
    word=S+t

    if f(word,N,S,T):
        if ans>len(word):
            ans=len(word)
    else:
        pass

print(ans)
# Judge status: Accepted
n=str(input())
a=[i for i in n]
if a[0]==a[1]==a[2]:
    print("Yes")
elif a[1]==a[2]==a[3]:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
n=int(input())
a=list(map(int,input().split()))
m=max(a)
a.sort()
dp=[True]*(m+1)
h=dict()
for i in a:
    if i not in h:
        h[i]=1
    else:
        h[i]+=1
    j=2
    while j*i<=m:
        dp[i*j]=False
        j+=1
ans=0
for i in a:
    if dp[i]==True and h[i]==1:
        ans+=1
print(ans)
# Judge status: Accepted
N = int(input())
a = list(map(int, input().split()))
count = 0
i = 0
for i in range(N-1):
  if a[i] <= a[i+1]:
    continue
  elif a[i] > a[i+1]:
    diff = a[i] - a[i+1]
    count = count + diff
    a[i+1] = a[i]
print(count)
# Judge status: Wrong Answer
import sys, heapq, bisect, math, fractions
from collections import deque

mod = 2019
L, R = map(int, input().split())

modL = L % mod
modR = R % mod

if R - L >= 2018:
    print(0)
else:
    if modL > modR:
        print(0)
    else:
        print(modL * ((modL + 1) % mod) % mod)
# Judge status: Accepted
n=int(input())
A=list(map(int,input().split()))
ans4 = 0
ans2 = 0
for a in A:
  if a % 4 == 0:
    ans4 += 1
  elif a % 2 == 0:
    ans2 += 1
ans2 = ans2-(ans2%2)
if (n-ans2)//2 <= ans4:
  print("Yes")
else:
  print("No")
# Judge status: Wrong Answer
n = int(input())
if n <=10:
    print(n)
elif n % 10 == 0:
    print(min(10,n//10+n%10))
else:
    print(n//10+n%10)
# Judge status: Wrong Answer
S=input()
T=input()
for i in range(1,len(S)):
    if S[-i:]+S[:-i]==T:
        print('Yes')
        exit()
print('No')
# Judge status: Accepted

def resolve():
    MOD = 998244353
    N = int(input())
    D = list(map(int, input().split()))

    if D[0] != 0:
        print(0)
        return

    CNT = [0] * N
    for i in D:
        CNT[i] += 1

    if CNT[0] > 1:
        print(0)
        return

    ans = 1
    for i in range(1, N):
        ans *= pow(CNT[i - 1], CNT[i], MOD)
        ans %= MOD

    print(ans)


if __name__ == "__main__":
    resolve()
# Judge status: Accepted
N, K = map(int,input().split())
x = list(map(int,input().split()))
ans = float("inf")
for i in range(N-K+1):
    ans = min(ans, abs(x[i])+abs(x[i]-x[i+K-1]))
    ans = min(ans, abs(x[i+K-1])+abs(x[i]-x[i+K-1]))
print(ans)
# Judge status: Accepted
import bisect
n,m,k=map(int,input().split())
a=list(map(int,input().split()))
b=list(map(int,input().split()))
a_sum=[]
b_sum=[]
a_sum.append(0)
b_sum.append(0)
for i in range(n):
    a_sum.append(a_sum[i]+a[i])
for j in range(m):
    b_sum.append(b_sum[j]+b[j])
ans=0
for x in range(n+1):
    timecount=k-a_sum[x]
    if timecount>=0:
        y=bisect.bisect_right(b_sum,k-a_sum[x])-1
        ans=max(x+y,ans)
    else:
        break
print(ans)
# Judge status: Wrong Answer
n,m = map(int,input().split())
xy = [[int(i) for i in input().split()] for _ in range(m)]
num = [1]*n
red = [False]*n
red[0] = True
flag = True
for i in range(m):
    p = xy[i][0]
    q = xy[i][1]
    num[p-1] -= 1
    num[q-1] += 1
    if red[p-1]==True:
        red[q-1] = True
    if i==0:
        red[0] = False

count = 0
for i in range(n):
    if num[i]>0 and red[i]:
        count += 1
print(count)
# Judge status: Accepted
N=int(input())
a=list(map(int,input().split()))

d = [0]*(10**5+1)
for i in range(N):
  d[a[i]]+=1

ans=0
for i in range(10**5):
  ans = max(ans, d[i-1]+d[i]+d[i+1])

print(ans)
# Judge status: Accepted
import sys,math,collections,itertools
input = sys.stdin.readline

N = int(input())
A=sorted(list(map(int,input().split())))
B = A[-1::-1]

GCA = [0]
GCB = [0]
for i in range(N):
    GCA.append(math.gcd(GCA[-1],A[i]))
    GCB.append(math.gcd(GCB[-1],B[i]))
GCB = GCB[-1::-1]

m=[]
for i in range(N):
    m.append(math.gcd(GCA[i],GCB[i+1]))
print(max(m))
# Judge status: Wrong Answer
N,K = map(int, raw_input().split())

d = int(N/K)
if d == 0:
    print N
else:
    p = [abs(N - K*(d-1)), abs(N - K*d), abs(N - K*(d+1))]
    print min(p)
# Judge status: Wrong Answer
n, m = map(int, input().split())

if n < m // 2:
    res = n + (m - n) // 4
    print(res)
else:
    res = m // 2
    print(res)
# Judge status: Accepted
N, A, B = list(map(int, input().split()))
if N > A + B:
  set_n = N // (A+B)
  N0 = N % (A+B)
  print(A * set_n + min(N0, A))
else:
  print(min(N, A))
# Judge status: Accepted
a, b, c = map(int, input().split())

ans = 0
while (a % 2 == 0) & (b % 2 == 0) & (c % 2 == 0):
    a, b, c = (b + c) // 2, (c + a) // 2, (a + b) // 2
    ans += 1
    if ans>1000000:
        ans = -1
        break
print(ans)
# Judge status: Wrong Answer
from sys import stdin
n = int(stdin.readline().rstrip())
s = stdin.readline().rstrip()
t = stdin.readline().rstrip()
u = s[::-1]
point = 0
for i,j in zip(u,t):
    if i == j:
        point += 1
    else:
        break
print(len(s[:-1*point]+t))
# Judge status: Wrong Answer
a, b = map(int, input().split())

new_a = a / 0.08
new_b = b / 0.10

if new_a > new_b:
  tax = a
  while tax == a:
    new_a -= 1
    tax = new_a * 0.08
    print(int(new_a + 1))
elif new_a <= new_b:
  tax = b
  while tax == b:
    new_b -= 1
    tax = new_b * 0.10
    print(int(new_b + 1))
else:
  print("-1")
# Judge status: Wrong Answer
a, b = map(int, input().split())
if a*b%2==0:
  print('Even')
else:
  print('0dd')
# Judge status: Accepted
#input
N, K = map(int, input().split())
h = list(map(int, input().split()))

#output
dp = [0] * N
dp[1] = abs(h[1]-h[0])

for i in range(2, N):
    temp = abs(h[i]-h[i-1]) + dp[i-1]
    for j in range(2, K+1):
        if 0<= i-j <= N-1:
            temp = min(temp, dp[i-j]+abs(h[i]-h[i-j]))
    dp[i] = temp

print(dp[N-1])
# Judge status: Accepted
from collections import defaultdict
N = int(input())


m = defaultdict(int)

for i in range(1, N+1):
    s = str(i)
    if s[-1] != "0":
        m[s[0] + s[-1]] += 1

ans = 0
for i in range(1, N+1):
    s = str(i)
    ans += m[s[-1] + s[0]]


print(ans)
# Judge status: Accepted
import sys


def f(x, y):
    return x - y, x + y


def main():
    input = sys.stdin.buffer.readline
    n = int(input())
    x = [0] * n
    y = [0] * n
    for i in range(n):
        x[i], y[i] = map(int, input().split())
    f0 = [0] * n
    f1 = [0] * n
    for i in range(n):
        f0[i], f1[i] = f(x[i], y[i])
    print(max(max(f0) - min(f0), max(f1) - min(f1)))


if __name__ == "__main__":
    main()
# Judge status: Wrong Answer
s = str(input())
n = len(s)
print(s)
s = s[::-1]
print(s)
x, tot = 1, 0
m = 2019
ans = 0
cnt = [int() for _ in range(m)]
for i in range(n):
    cnt[tot] += 1
    tot += (int(s[i])) * x
    tot %= m
    ans += cnt[tot]
    x = x * 10 % m
print(ans)
# Judge status: Accepted
N=int(input())
A=list(map(int,input().split()))
H=A[0]
ans=0
for i in range(N):
    ans+=max(0,(H-A[i]))
    H=max(H,A[i])
    #print(H)
print(ans)
# Judge status: Accepted
S=input()
T=input()

for i in range(len(S)):
  if S[i]==T[i]:
    continue
  else:
    print('No')
    exit()
if len(S)+1 ==len(T):
  print('Yes')
else:
  print('No')
# Judge status: Wrong Answer
N, W = map(int, input().split())
wv = [list(map(int, input().split())) for i in range(N)]

dp = [[0] * (W + 1) for _ in range(N + 1)]

for i in range(1, N + 1):
    for j in range(W + 1):
        if j < wv[i - 1][0]:
            dp[i][j] = max(dp[i][j], dp[i - 1][j])
        else:
            dp[i][j] = max(dp[i][j], dp[i - 1][j - wv[i - 1][0]] + wv[i - 1][1])

print(max(max(dp)))
# Judge status: Wrong Answer
n, k, s = map(int, input().split())

aa = [s]*k +[1]*(n-k)
print(*aa)
# Judge status: Accepted
import bisect
N,M,K= map(int, input().split())
A = list(map(int, input().split()))
B = list(map(int, input().split()))

dpA = [0]*(N+1)
dpB = [0]*(M+1)

for i in range(1,N+1):
    dpA[i] = dpA[i-1] + A[i-1]

for i in range(1,M+1):
    dpB[i] = dpB[i-1] + B[i-1]

ans = 0
for i in range(N+1):
    if dpA[i] > K:
        continue
    indexB = bisect.bisect_right(dpB, K - dpA[i])
    ans = max(ans, i + indexB - 1)

print(ans)
# Judge status: Accepted
n = int(input())
k = int(input())
x = int(input())
y = int(input())


if k >= n:
    print(x*n)
else:
    print(x*k + y*(n-k))
# Judge status: Wrong Answer
n,m=map(int,input().split())
l=[1]
k=m//n
for i in range(2,int(m**0.5)+2):
  if m%i==0:
    if i<=k:
      l.append(i)
    if (m//i)<=k:
      l.append(m//i)
print(max(l))
# Judge status: Accepted
sList = sorted(list(set(list(input()))))
chI = ord('a')
for i in sList:
  if chI == ord(i):
    chI += 1
  else:
    print(chr(chI))
    exit(0)
if len(sList) != 26:
  print(chr(chI))
else:
  print("None")
# Judge status: Wrong Answer
import heapq
n=int(input())
A=list(map(lambda x:int(x)*(-1),input().split()))
ans=10**9
heapq.heapify(A)
tmp=0
for i in range(1,len(A)):
  tmp+=heapq.heappop(A)
  ans=min(ans,abs(sum(A)-tmp))
print(ans)
# Judge status: Wrong Answer
a500 = int(input())
b100 = int(input())
c50 = int(input())
_x = int(input())
answer = 0
for c in range(c50+1):
    for b in range( b100+1):
        for a in range(a500+1):
            print (a,b,c)
            if a*500 + b*100 + c*50 == _x:
                answer += 1
print (answer)
# Judge status: Accepted
n, m = map(int, input().split())

print(m//2 if n >= m//2 else n+(m-n*2)//4)
# Judge status: Accepted
a, b, c = map(int, input().split())
if a < b:
    if a < c < b:
        print('Yes')
    else:
        print('No')
else:
    if b < c < a:
        print('Yes')
    else:
        print('No')
# Judge status: Wrong Answer
a = int(input())
s = input()

if a < 3200:
  print(s)
else:
  print("red")
# Judge status: Accepted
import sys
def input(): return sys.stdin.readline().strip()

def resolve():
    a, b, x = map(int, input().split())
    if a <= x <= a + b:
        print('YES')
    else:
        print('NO')
resolve()
# Judge status: Wrong Answer
S=input()
string1 = 'R'
string2 = 'RR'
if S.count(string1) == 0:
    print('0')
if S.count(string1) == 1 or S == 'RSR':
    print('1')
if S.count(string2) == 1:
    print('2')
if S.count(string1) == 3:
    print('3')
# Judge status: Wrong Answer
import math
n = input()
a = list(map(int, input().split()))
ans = float("inf")
for i in a:
    ans = min(ans, len(bin(i)) - bin(i).rfind("1"))
print(round(ans))
# Judge status: Accepted
n, m = map(int, input().split())
A = list(map(int, input().split()))

B = []
C = []
for i in range(m):
    b, c = map(int, input().split())
    B.append(b)
    C.append(c)

D = zip(C, B)
D = sorted(D)
C, B = zip(*D)
C = reversed(C)
B = reversed(B)
total = 0

for i, j in zip(C, B):
    if total >= n:
        break
    else:
        total += j
        A.extend([i] * j)

A = sorted(A)
print(sum(A[-n:]))
# Judge status: Wrong Answer
import itertools
import numpy as np

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

comb = np.array(list(itertools.combinations(Al, 2))).sum(axis = 1)
comb_i = np.array(list(itertools.combinations(np.arange(1, N+1), 2))).mean(axis = 1)

print((comb == comb_i).sum())
# Judge status: Wrong Answer
S = input()

if S == 'ABA':
    print('Yes')
elif S == 'BAB':
    print('Yes')
else:
    print('No')
# Judge status: Accepted
from math import gcd
a, b, k = map(int, input().split())

g = gcd(a, b)

for i in range(g, 0, -1):
    if g % i == 0:
        k -= 1
        if k == 0:
            print(i)
            break
# Judge status: Wrong Answer
n, k = map(int, input().split())
x = list(map(int, input().split()))
neg_num = n

for i in range(n):
    if x[i] > 0:
        neg_num = i
        break
pos_num = n - neg_num

l = min(k, neg_num)
res = 10 ** 13
for i in range(l, -1, -1):
    r = k - i
    if r <= pos_num:
        l_val = min(0, x[neg_num - i])
        r_val = x[neg_num + k - i - 1]
        tmp = min( -l_val * 2 + r_val, -l_val + r_val * 2)
        res = min(tmp, res)
print(res)
# Judge status: Accepted
N = int(input())
A = [int(input()) for _ in range(N)]
A.append(0)

con = False
ans = 0

for i in range(N):
    if A[i] >=2:
        ans += A[i]//2
        A[i] -= (A[i]//2)*2
    
    mm = min(A[i+1],A[i])
    ans += mm
    A[i+1] -= mm
    A[i] -= mm
    #print(A)


print(ans)
# Judge status: Accepted
n,m=map(int,input().split())
c = [0]*m
for i in range(n):
  a = list(map(int, input().split()))
  for e in a[1:]:
    c[e-1] += 1
print(c.count(n))
# Judge status: Accepted
s = input()
K = int(input())

ans = []

for i in s:
    if i == "a":
        ans.append("a")
        continue
    
    if ord(i) + K >= ord("z") + 1:
        ans.append("a")
        K -= ord("z") + 1 - ord(i)
    
    else:
        ans.append(i)
        


last = (K + ord(ans[-1]) - ord('a')) % 26
ans[-1] = chr(ord("a") + last)
print(''.join(ans))
# Judge status: Wrong Answer
# print('input >>')
N = input()
N = reversed(N)
ans = 0
nxt = False
for n in N:
    i_n = int(n) + nxt
    if i_n % 10 >= 6:
        ans += 10 - i_n % 10
        nxt = True
    else:
        ans += i_n % 10
        nxt = False
    # print(N, ans)
# Judge status: Wrong Answer
A, B = (int(x) for x in input().split())

S = A
num  = 1
i = 0

while(S < B):
    i += 1
    A = A * 2
    S = A - i
    num += 1

print(num)
# Judge status: Accepted
def b():
    red, green, blue = map(int, input().split())
    k = int(input())

    for i in range(k):
        if green <= red:
            green *= 2
        elif blue <= green:
            blue *= 2
        else:
            print('Yes')
            return

    if blue > green > red:
        print('Yes')
    else:
        print('No')


##########
if __name__ == "__main__":
    b()