Problem:
 Score: 200 points    Problem Statement  M-kun has the following three cards:   A red card with the integer A .  A green card with the integer B .  A blue card with the integer C .   He is a genius magician who can do the following operation at most K times:   Choose one of the three cards and multiply the written integer by 2 .   His magic is successful if both of the following conditions are satisfied after the operations:   The integer on the green card is strictly greater than the integer on the red card.  The integer on the blue card is strictly greater than the integer on the green card.   Determine whether the magic can be successful.      Constraints   1 \leq A, B, C \leq 7  1 \leq K \leq 7  All values in input are integers.         Input  Input is given from Standard Input in the following format:  A  B  C  K       Output  If the magic can be successful, print Yes ; otherwise, print No .        Sample Input 1 7 2 5
3      Sample Output 1 Yes  The magic will be successful if, for example, he does the following operations:   First, choose the blue card. The integers on the red, green, and blue cards are now 7 , 2 , and 10 , respectively.  Second, choose the green card. The integers on the red, green, and blue cards are now 7 , 4 , and 10 , respectively.  Third, choose the green card. The integers on the red, green, and blue cards are now 7 , 8 , and 10 , respectively.        Sample Input 2 7 4 2
3      Sample Output 2 No  He has no way to succeed in the magic with at most three operations.

Solution (Python):


import math

import itertools
from collections import deque
from collections import Counter

from fractions  import gcd

import bisect
a,b,c=map(int,input().split())
k=int(input())
cnt=0
y=0
while True:
    x=pow(2,y)
    if a<b*x:
        b*=x
        break
    else:
        cnt+=1
        y+=1
y=0

while True:
    x=pow(2,y)
    if b<c*x:
        c*=x
        break
    else:
        cnt+=1
        y+=1
if cnt<=k:
    print("Yes")
else:
    print("No")

Solution (Python):
red, green, blue = map(int, input().split())
k = int(input())

ans = 'No'

while k != 0:
    if blue > green > red:
        ans = 'Yes'
        break
    elif blue <= green or blue <= red:
        blue *= 2
    elif green <= red:
        green *= 2
    k -= 1

if blue > green > red:
    ans = 'Yes'

print(ans)

Solution (Python):

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

flag = True
for f in range(K):
    g = 2 ** f
    h = 2**(K - f)
    
    
    bm = b * g
    cm = c * h

    if a < bm and bm < cm:
        print('Yes')
        flag = False
        break

if flag:
    print('No')

Solution (Python):
a, b, c = map(int, input().split())
k = int(input())

for i in range(k):
    if c <= b:
        c *= 2
    elif b <= a:
        b *= 2

if c > b and b > a:
    print('Yes')
else:
    print('No')

Solution (Python):
cards = list(map(int, input().split()))
K = int(input())
for i in range(K):
    if cards[0] >= cards[1]:
        cards[1] *= 2
    else:
        cards[2] *= 2

if cards[0] < cards[1] < cards[2]:
    print('Yes')
else:
    print('No')

Solution (Python):
a,b,c = map(int, input().split())
k = int(input())

cnt=0
while a >= b:
  k -= 1
  b *= 2
while b >= c:
  k -= 1
  c *= 2

if a < b < c and k >= 0:
  print("Yes")
else:
  print("No")

Solution (Python):



def main():
    red, green, blue = map(int, input().split())
    k = int(input())
    res = "No"
    for i in range(k):
        if blue <= green or blue <= red:
            blue *= 2
        elif green <= red:
            green *= 2
        if blue > green and green > red:
            res = "Yes"
            break
    print(res)


if __name__ == "__main__":
    main()

Solution (Python):
import bisect,collections,copy,heapq,itertools,math,string
import sys
def S(): return sys.stdin.readline().rstrip()
def M(): return map(int,sys.stdin.readline().rstrip().split())
def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def LS(): return list(sys.stdin.readline().rstrip().split())
a, b, c = M()
k = I()
for _ in range(k):
    if a >= b:
        b = 2*b
    else:
        c = 2*c
if a < b < c:
    print('Yes')
else:
    print('No')

Solution (Python):
A,B,C=map(int,input().split())
K=int(input())

for i in range(K+1) :
    for j in range(K+1-i) :
        a=A*(2**i)
        b=B*(2**j)
        c=C*(2**(K-i-j))
        if a<b<c :
            print("Yes")
            exit()

print("No")

Solution (Python):
a,b,c=map(int,input().split())
k=int(input())
count1=0
while a>=b:
    b=2*b
    count1+=1
count2=0
while b>=c:
    c=2*c
    count2+=1
if count1+count2<=k:
    print("Yes")
else:
    print("No")

Solution (Python):
A, B, C = map(int, input().split())
K = int(input())
while not B > A:
        B *= 2
        K -= 1
while not C > B:
        C *= 2
        K -= 1

if K < 0:
    print("No")
else:
    print("Yes")

Solution (Python):
from sys import stdin, stdout
import heapq
import cProfile
from collections import Counter, defaultdict, deque
from functools import reduce
import math
import string

def get_int():
    return int(stdin.readline().strip())


def get_tuple():
    return map(int, stdin.readline().split())


def get_list():
    return list(map(int, stdin.readline().split()))

a,b,c = get_tuple()
k = get_int()
ans = 0
while b<=a:
    ans += 1
    b *= 2

while c<=b:
    ans += 1
    c *= 2
if ans<=k:
    print("Yes")
else:
    print("No")

Solution (Python):
def double(x, y):
    global count

    for _ in range(7):
        if x < y:
            break

        y *= 2
        count += 1

    return y


def main():
    a, b, c = map(int, input().split())
    k = int(input())

    b = double(a, b)
    c = double(b, c)

    if count <= k:
        print("Yes")
    else:
        print("No")


if __name__ == "__main__":
    count = 0
    main()

Solution (Python):
from collections import defaultdict
from collections import deque
from collections import OrderedDict
import itertools
from sys import stdin
input = stdin.readline


def main():
  A, B, C = list(map(int, input().split()))
  K = int(input())

  for i in range(K+1):
    for j in range(K-i+1):
      AA = A*(2**i)
      BB = B*(2**j)
      CC = C*(2**(K-i-j))
      if AA < BB < CC:
        print('Yes')
        return

  print('No')


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

Solution (Python):
import sys
input = sys.stdin.readline


class Solve:
    def __init__(self):
        self.flag = False

    def helper(self, a, b, c, k):
        if k == 0:
            if b > a and c > b:
                self.flag = True
                return
            else:
                return
        else:
            self.helper(a * 2, b, c, k - 1)
            self.helper(a, b * 2, c, k - 1)
            self.helper(a, b, c * 2, k - 1)


def main():
    a,b,c = [int(i) for i in input().strip().split()]
    k = int(input().strip())
    
    solver = Solve()

    solver.helper(a, b, c, k)
    if solver.flag:
        print("Yes")
    else:
        print("No")



    return

if __name__ == "__main__":
    main()

Solution (Python):
a,b,c = map(int,input().split())
k = int(input())

for i in range(k):
    if b <= a:
        b *= 2
    elif c <= b:
        c *= 2

if (a < b and b < c):
    print("Yes")
else:
    print("No")

Solution (Python):
a, b, c = map(int, input().split())
k = int(input())


def solve(a, b, c, k):
    while b <= a:
        b *= 2
        k -= 1
    while c <= b:
        c *= 2
        k -= 1
    return k >= 0



print("Yes" if solve(a, b, c, k) else "No")

Solution (Python):
R,G,B = map(int,input().split())

K = int(input())

count = 0

while not R < G:
    G *= 2
    count += 1

while not G < B:
    B *= 2
    count += 1

if count <= K:
    print("Yes")
else:
    print("No")

Solution (Python):
A,B,C = map(int, input().split())
K = int(input())

for i in range(1,K+1):
    if A >= B:
        B = B * 2
    elif B >= C:
        C = C * 2

    if A < B < C:
        print('Yes')
        exit()

print('No')

Solution (Python):
A, B, C = map(int, input().strip().split())
K = int(input())

while A >= B and K > 0:
    B = B * 2
    K -= 1

while B>=C and K>0:
    C=C*2
    K-=1

if A<B and B<C :
    print("Yes")
else:
    print("No")

Solution (Python):


a, b, c = map(int, input().split())
k = int(input())
count = 0
while b <= a:
  b *= 2
  count += 1
while c <= b:
  c *= 2
  count += 1


if count > k:
  print('No')
else:
  print('Yes')

Solution (Python):
A, B, C = map(int, input().split())
K = int(input())

for i in range(K):
    if B <= A:
        B *= 2
    else:
        if C <= B:
            C *= 2

if A < B < C:
    print("Yes")
else:
    print("No")

Solution (Python):
import sys
input = sys.stdin.readline

'''

'''

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

def solve(k, tup):
    a, b, c = tup
    while k > 0:
        if a >= b:
            b *= 2
            k -= 1
            continue
        if b >= c:
            c *= 2
            k -= 1
            continue

        return "Yes"
    
    if a < b < c:
        return "Yes"
    else:
        return "No"


print(solve(k, (a, b, c)))

Solution (Python):
a, b, c = map(int, input().split())
k = int(input())
ans = 0
while b <= a:
	b *= 2
	ans += 1
while c <= b:
	c *= 2
	ans += 1

if ans <= k:
	print("Yes")
else:
	print("No")

Solution (Python):
A, B, C = map(int, input().split())
K = int(input())
for _ in range(K):
    if B <= A:
        B *= 2
    elif C <= B:
        C *= 2
    else:
        break
print("Yes" if A < B and B < C else "No")

Solution (Python):

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


k=int(input())
ans='No'
for i in range(0,k+1):
    cnew=c*(2**(i))
    bnew=b*(2**(k-i))
    if a<bnew and bnew<cnew:
        ans='Yes'
print(ans)

Solution (Python):
import sys, math
from collections import defaultdict
from itertools import product
sys.setrecursionlimit(500000)
MOD = 10**9+7

def input():
    return sys.stdin.readline()[:-1]

def mi():
    return map(int, input().split())

def ii():
    return int(input())

def i2(n):
    tmp = [list(mi()) for i in range(n)]
    return [list(i) for i in zip(*tmp)]

def f(K, A, B, C):
    if K == 0:
        return False
    return (2*A < B < C) or f(K-1, 2*A, B, C) \
        or (A < 2*B < C) or f(K-1, A, 2*B, C) \
        or (A < B < 2*C) or f(K-1, A, B, 2*C)

def main():
    A, B, C = list(mi())
    K = ii()

    print('Yes' if f(K, A, B, C) else 'No')



if __name__ == '__main__':
    main()

Solution (Python):

import os
from sys import stdin, stdout

def backtrack(a,b,c,k):
    if k==0:
        if a<b<c:
            return True
        return False
    
    ret = False
    ret |= backtrack(a*2,b,c,k-1)
    ret |= backtrack(a,b*2,c,k-1)
    ret |= backtrack(a,b,c*2,k-1)
    return ret

def solve(tc):
    a, b, c = map(int, stdin.readline().split())
    k = int(stdin.readline().strip())

    if backtrack(a,b,c,k):
        print("Yes")
    else:
        print("No")
    return

tcs = 1
tc = 1
while tc <= tcs:
    solve(tc)
    tc += 1

Solution (Python):
A, B, C = list(map(int, input().split()))
K = int(input())

count = 0
count2 = 0

for i in range(100):
    if A < B:
        break
    B = B * 2
    count += 1

for i in range(100):
    if B < C:
        break
    C = C * 2
    count2 += 1

if K >= count + count2:
    print('Yes')
else:
    print('No')

Solution (Python):
A,B,C = map(int,input().split())
K = int(input())
count = 0
while A >= B:
    B *= 2
    count += 1
while B >= C:
    C *= 2
    count += 1
if count <= K:
    print('Yes')
else:
    print('No')

Solution (Python):
red, green, blue = map(int, input().split())

K = int(input())



for i in range(K):
    if green <= red:
        green *= 2
        continue
    if blue <= green:
        blue *= 2

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

Solution (Python):
a,b,c=map(int,input().split())
k=int(input())

cnt=0

while a>=b:
    b*=2
    cnt+=1

while b>=c:
    c*=2
    cnt+=1

if cnt<=k:
    print("Yes")
else:
    print("No")

Solution (Python):
a, b, c = map(int, input().split())
k = int(input())
for _ in range(k):
    if a >= b:
        b *= 2
    else:
        c *= 2

    if a < b < c:
        print("Yes")
        break
else:
    print("No")

Solution (Python):


import sys
import math
import time

import collections
from collections import deque
from collections import Counter
import queue
import copy
import bisect
import heapq
import itertools









A, B, C = map(int, input().split())
K = int(input())
ans = "No"

while True:
  if(A<B and B<C):
    ans = "Yes"
  if(K==0):
    break
  if(A<B):
    C = C*2
    K-=1
  else:
    B = B*2
    K -= 1


print(ans)

Solution (Python):
A,B,C = map(int,input().split())
K = int(input())
cb = 0
cc =0
while B<=A:
  B=B*2
  cb =cb +1
  
while C<=B:
  C = C*2
  cc = cc+1
if cb+cc > K:
  print('No')
else:
  print('Yes')

Solution (Python):
A,B,C = map(int,input().split())
K = int(input())
for i in range(K):
    if A >= B:
        B *= 2
    elif B >= C:
        C *= 2
if A < B < C:
    print('Yes')
else:
    print('No')

Solution (Python):

def m():
    A, B, C = map(int, input().split())
    K = int(input())
    while A >= B:
        B *= 2
        K -= 1

    while B >= C:
        C *= 2
        K -= 1

    if K < 0:
        return 'No'
    else:
        return 'Yes'

print(m())

Solution (Python):
import sys
input = sys.stdin.readline

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

while(a >= b and k>0):
    b *= 2
    k -= 1

while(b >= c and k>0):
    c *= 2
    k -= 1

if a < b < c:
    print("Yes")
else:
    print("No")

Solution (Python):
a,b,c = map(int, input().split())
k =int(input())

cnt = 0
while b<=a:
    cnt += 1
    b *= 2
while c <= b:
    cnt += 1
    c *= 2
    
if cnt <= k:
    print("Yes")
else:
    print("No")

Solution (Python):
A, B, C = map(int, input().split())
K = int(input())

i = 0

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


while(C<=B):
    i += 1
    C *= 2


    
if i <=K:
    print("Yes")
else:
    print("No")

Solution (Python):
a, b, c = map(int,input().split())
k = int(input())
while k and a-b>=0:
    b *= 2
    k -= 1
while k and b-c>=0:
    c *= 2
    k -= 1
if a<b<c:
    print('Yes')
else:
    print('No')

Solution (Python):
a,b,c = map(int,input().split())
k = int(input())

for i in range(k):
    if a >= b:
        b *= 2
    elif b >= c:
        c *= 2
    else:
        break

if a < b and b < c:
    print("Yes")
else:
    print("No")

Solution (Python):
A, B, C = map(int, input().split())
K = int(input())

for _ in range(K):
    if A >= B:
        B *= 2
        continue
    if B >= C:
        C*= 2
        continue

if A < B < C:
    print("Yes")
else:
    print("No")

Solution (Python):
A,B,C = map(int, input().split())
K = int(input())

cnt = 0
while A >= B:
    B *= 2
    cnt += 1
while B >= C:
    C *= 2
    cnt += 1
if cnt <= K:
    print("Yes")
else:
    print("No")

Solution (Python):
A, B, C = map(int, input().split())
K = int(input())

def solve(A, B, C, K):
    while (A >= B):
        B *= 2
        K -= 1
        if K < 0:
            print("No")
            return
    
    while (B >= C):
        C *= 2
        K -= 1
        if K < 0:
            print("No")
            return
    
    print("Yes")
    return

solve(A, B, C, K)

Solution (Python):
a,b,c = map(int,input().split())
k = int(input())
while b <= a:
    b *= 2
    k -= 1
while c <= b:
    c *= 2
    k -= 1
if k >= 0:
    print('Yes')
else:
    print('No')

Solution (Python):
a,b,c = map(int,input().split())
k = int(input())

tmp = k

while b <= a:
    b *= 2
    tmp -= 1

while c <= b:
    c *= 2
    tmp -= 1



if tmp >= 0:
    print('Yes')
else:
    print('No')

Solution (Python):
import sys, bisect, math, itertools, heapq, collections
from operator import itemgetter

from functools import lru_cache

sys.setrecursionlimit(10**8)
input = sys.stdin.readline
INF = float('inf')
mod = 10**9 + 7
eps = 10**-7


def inp():
    '''
    一つの整数
    '''
    return int(input())


def inpl():
    '''
    一行に複数の整数
    '''
    return list(map(int, input().split()))


def str_inp():
    '''
    文字列をリストとして読み込む
    '''
    return list(input()[:-1])


a, b, c = inpl()
k = inp()
FLAG = True
while k:
    if b > a:
        FLAG = False
        break
    b *= 2
    k -= 1
if FLAG:
    print("No")
    exit()
FLAG = True
while k:
    if c > b:
        break
    c *= 2
    k -= 1
if FLAG and c <= b:
    print("No")
    exit()
print("Yes")

Solution (Python):
a,b,c = map(int,input().split())
k = int(input())
o = 0
while (a >= b):
    b *= 2
    o += 1
while (b >= c):
    c *= 2
    o += 1
print("Yes" if o <= k else "No")

Solution (Python):
import sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from functools import reduce
from bisect import bisect_left, insort_left
from heapq import heapify, heappush, heappop

INPUT = lambda: sys.stdin.readline().rstrip()
INT = lambda: int(INPUT())
MAP = lambda: map(int, INPUT().split())
S_MAP = lambda: map(str, INPUT().split())
LIST = lambda: list(map(int, INPUT().split()))
S_LIST = lambda: list(map(str, INPUT().split()))
ZIP = lambda: zip(*(MAP() for _ in range(n)))

sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7


def main():
    A, B, C = MAP()
    K = INT()

    cnt = 0
    while True:
        if A < B: break
        B *= 2
        cnt += 1

    while True:
        if B < C: break
        C *= 2
        cnt += 1

    print("Yes" if cnt <= K else "No")


if __name__ == '__main__':
    main()

Solution (Python):
A,B,C=map(int,input().split())
K=int(input())

numbers=[A,B,C]

for k in range(K):
    a=numbers[0]
    b=numbers[1]
    c=numbers[2]
    if c<=a or c<=b:
        c*=2
        numbers[2]=c
    elif b <= a:
        b*=2
        numbers[1]=b

if numbers[0]< numbers[1] and numbers[1]<numbers[2]:
    print('Yes')
else:
    print('No')

Solution (Python):
a, b, c = map(int, input().split())
k = int(input())

cnt = 0
while a >= b:
    b *= 2
    cnt += 1
while b >= c:
    c *= 2
    cnt += 1
print('Yes' if cnt <= k else 'No')

Solution (Python):
A, B, C = list(map(int, input().strip().split()))
K = int(input().strip())

count = 0
while not(A < B):
  B = B*2
  count+=1
while not(B < C):
  C = C*2
  count += 1
if count <= K:
  print('Yes')
else:
  print('No')

Solution (Python):

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

for i in range(K):
  if C <= B:
    C *= 2
  elif B <= A:
    B *= 2

if C > B and B > A:
  print('Yes')
else:
  print('No')

Solution (Python):
A,B,C=map(int,input().split())
K=int(input())
cnt=0
while A>=B and cnt<K:
  B=2*B
  cnt+=1

while B>=C and cnt<K:
  C=2*C
  cnt+=1

if A<B<C:
  print("Yes")
else:
  print("No")

Solution (Python):
from itertools import product
def solve():
    card_org = list(map(int,input().split()))
    K = int(input())
    comb = list(product(range(3), repeat=K))

    for c in comb:
        card = card_org[:]
        if card[1] > card[0] and card[2] > card[1]:
            print('Yes')
            return

        for i in range(K):
            card[c[i]] *= 2
        
            if card[1] > card[0] and card[2] > card[1]:
                print('Yes')
                return
    
    print('No')

if __name__ == '__main__':
    solve()

Solution (Python):

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

for _ in range(K):
    if B >= C:
        C *= 2
    elif A >= B:
        B *= 2

if A < B and B < C:
    print('Yes')
else:
    print('No')

Solution (Python):
a, b, c, k = map(int, open(0).read().split())

while a >= b:
    b *= 2
    k -= 1

while b >= c:
    c *= 2
    k -= 1

if k >= 0:
    print('Yes')
else:
    print('No')

Solution (Python):
a,b,c=map(int,input().split())
k=int(input())
for i in range(1,k+1):
    if a>=b:
        b*=2
    else:
        c*=2
if a<b<c:
    print('Yes')
else:
    print('No')

Solution (Python):
import sys, math
import io, os

from bisect import bisect_left as bl, bisect_right as br, insort
from heapq import heapify, heappush, heappop
from collections import defaultdict as dd, deque, Counter

def data(): return sys.stdin.readline().strip()
def mdata(): return list(map(int, data().split()))
def outl(var) : sys.stdout.write('\n'.join(map(str, var))+'\n')
def out(var) : sys.stdout.write(str(var)+'\n')

from fractions import Fraction

INF = float('inf')
mod = int(1e9)+7



a,b,c=mdata()
k=int(data())
while b<=a:
    b*=2
    k-=1
while c<=b:
    k-=1
    c*=2
if k>=0:
    out("Yes")
else:
    out("No")

Solution (Python):
a,b,c = map(int, input().split())
k = int(input())

kaisuu = 0

while a >= b:
    b*=2
    kaisuu += 1

while b >= c:
    c*=2
    kaisuu += 1

if kaisuu <= k:
    print('Yes')
else:
    print('No')

Solution (Python):

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

counter = 0
for i in range(K):
    if A >= B:
        B *= 2
        counter += 1

for i in range(K):
    if B >= C:
        C *= 2
        counter += 1

if A < B and B < C and counter <= K:
    print("Yes")
else:
    print("No")

Solution (Python):
A,B,C=map(int,input().split())
K=int(input())
for x in range(K):
  if A>=B:
    B*=2
  elif B>=C:
    C*=2
  else:
    break
if C>B and B>A:
  print("Yes")
else:
  print("No")

Solution (Python):
import sys
sys.setrecursionlimit(1000000000)
import math
from math import gcd
def lcm(a, b): return a * b // gcd(a, b)
from itertools import count, permutations, chain, product
from functools import lru_cache
from collections import deque, defaultdict
from pprint import pprint
ii = lambda: int(input())
mis = lambda: map(int, input().split())
lmis = lambda: list(mis())
INF = float('inf')
N1097 = 10**9 + 7

def meg(f, ok, ng):
    while abs(ok-ng)>1:
        mid = (ok+ng)//2
        if f(mid):
            ok=mid
        else:
            ng=mid
    return ok

def get_inv(n, modp):
    return pow(n, modp-2, modp)

def factorials_list(n, modp):    
    fs = [1]
    for i in range(1, n+1):
        fs.append(fs[-1] * i % modp)
    return fs

def invs_list(n, fs, modp):     
    invs = [get_inv(fs[-1], modp)]
    for i in range(n, 1-1, -1):
        invs.append(invs[-1] * i % modp)
    invs.reverse()
    return invs

def comb(n, k, modp):
    num = 1
    for i in range(n, n-k, -1):
        num = num * i % modp
    den = 1
    for i in range(2, k+1):
        den = den * i % modp
    return num * get_inv(den, modp) % modp

def comb_from_list(n, k, modp, fs, invs):
    return fs[n] * invs[n-k] * invs[k] % modp



class UnionFindEx:
    def __init__(self, size):
        
        self.roots = [-1] * size
    def getRootID(self, i):
        r = self.roots[i]
        if r < 0:   
            return i
        else:
            r = self.getRootID(r)
            self.roots[i] = r
            return r
    def getGroupSize(self, i):
        return -self.roots[self.getRootID(i)]
    def connect(self, i, j):
        r1, r2 = self.getRootID(i), self.getRootID(j)
        if r1 == r2:
            return False
        if self.getGroupSize(r1) < self.getGroupSize(r2):
            r1, r2 = r2, r1
        self.roots[r1] += self.roots[r2]    
        self.roots[r2] = r1
        return True

Yes = 'Yes'
No = 'No'


def main():
    A, B, C = mis()
    K = ii()
    q = []
    q.append((A, B, C))
    nq = []
    for _ in range(K+1):
        while q:
            a, b, c = q.pop()
            if a < b < c:
                print(Yes)
                return
            nq.append((a*2, b, c))
            nq.append((a, b*2, c))
            nq.append((a, b, c*2))
        nq, q = q, nq
    print(No)





main()

Solution (Python):
import sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from fractions import gcd
from bisect import bisect, bisect_left, bisect_right

def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def S_MAP(): return map(str, input().split())
def LIST(): return list(map(int, input().split()))
def S_LIST(): return list(map(str, input().split()))

sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

a, b, c = MAP()
k = INT()
flag = False
while a >= b and k > 0:
    b *= 2
    k -= 1

while b >= c and k > 0:
    c *= 2
    k -= 1

if a < b < c:
    print("Yes")
else:
    print("No")

Solution (Python):
a, b, c = map(int, input().split())
k = int(input())

while k > 0:
    if a >= b:
        b *= 2
    else:
        c *= 2
    k -= 1

print( "Yes" if a < b and b < c else "No")

Solution (Python):
import sys
from math import ceil
def input(): return sys.stdin.readline().strip()


def main():
    a, b, c = map(int, input().split())
    K = int(input())
    for i in range(1 << (K*2)):
        A, B, C = a, b, c
        for j in range(7):
            if not i & (1 << (2*j)) and not i & (1 << (2*j+1)):
                continue
            elif i & (1 << (2*j)) and not i & (1 << (2*j+1)):
                A *= 2
            elif not i & (1 << (2*j)) and i & (1 << (2*j+1)):
                B *= 2
            else:
                C *= 2
        if A < B and B < C:
            print("Yes")
            return
    print("No")

if __name__ == "__main__":
    main()

Solution (Python):
a,b,c = map(int, input().split())
k = int(input())
count = 0
for i in range(7):
  if a < b:
    break
  b *= 2
  count += 1

for j in range(7):
  if b < c:
    break
  c *= 2
  count += 1

if k >= count:
  print('Yes')
else:
  print('No')

Solution (Python):
A,B,C=map(int,input().split())
K=int(input())
n=0
while B<=A:
    B*=2
    n+=1
while C<=B:
    C*=2
    n+=1
if n>K:
    print("No")
else:
    print("Yes")

Solution (Python):
a,b,c = map(int,input().split())
k = int(input())
for i in range(k):
    if a < b:
        if b < c:
            break
        else:
            c *= 2
            if b < c:
                break
    else:
        b *= 2
else:
    print("No")
    exit()
print("Yes")

Solution (Python):
a,b,c=map(int,input().split())
k=int(input())
ans=0
while a>=b:
    ans+=1
    b*=2
while b>=c:
    ans+=1
    c*=2
if ans<=k:
    print("Yes")
else:
    print("No")

Solution (Python):
import sys


A, B, C = [int(x) for x in input().split(" ")]
K = int(input())

for i in range(K + 1):
    j = K - i
    if A < B * (2 ** i) and B * (2 ** i) < C * (2 ** j):
        print("Yes")
        sys.exit(0)
print("No")

Solution (Python):
import math
import sys
import collections
import bisect
readline = sys.stdin.readline


def main():
    a, b, c = map(int, readline().rstrip().split())
    k = int(readline().rstrip())
    i = 0
    while k > i:
        if a >= b:
            b *= 2
            i += 1
            continue
        if b >= c:
            c *= 2
            i += 1
            continue
        print('Yes')
        return
    print('Yes' if c > b and b > a else 'No')


if __name__ == '__main__':
    main()

Solution (Python):
a,b,c=map(int,input().split())
k=int(input())
ans=0
while(b<=a):
    b*=2
    ans+=1
while(c<=b):
    c*=2
    ans+=1
if(ans<=k):
    print("Yes")
else:
    print("No")

Solution (Python):
import math
a,b,c = map(int,input().split())
k = int(input())
co = 0
while b <= a:
	co += 1
	b *= 2
while c <= b:
	co += 1
	c *= 2

print('Yes' if co <= k else 'No')

Solution (Python):
a, b, c = map(int, input().split())
k = int(input())
 
cnt = 0
while a >= b:
  b = b * 2
  cnt += 1
while b >= c:
  c = c * 2
  cnt += 1
if cnt <= k:
  print("Yes")
else:
  print("No")

Solution (Python):
a, b, c = map(int, input().split())
k = int(input())
num = 0
while a >= b:
    b *= 2
    num += 1
while b >= c:
    c *= 2
    num += 1
print("Yes" if num <= k else "No")

Solution (Python):
from sys import stdin,stdout
r,g,b=map(int,stdin.readline().split())
k=int(stdin.readline())
while g<=r:
    k-=1
    g*=2
while b<=g:
    k-=1
    b*=2
print('Yes' if k>=0 else 'No')

Solution (Python):



import sys
from collections import defaultdict, deque
from heapq import heappush, heappop
import math
import bisect
import itertools

input = sys.stdin.readline




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

for x in list(itertools.combinations_with_replacement([0,1,2], k)):
    a_, b_, c_ = a, b, c
    for val in x:
        if val == 0:
            a_ *= 2
        elif val == 1:
            b_ *= 2
        elif val == 2:
            c_ *= 2
    if b_ > a_ and c_ > b_:
        print('Yes')
        sys.exit()
print('No')

Solution (Python):
a,b,c=map(int,input().split())
k=int(input())
for i in range(k):
  if a<b:
    break
  else:
    b*=2
    k-=1
for i in range(k):
  c*=2
if a<b<c:
  print('Yes')
else:
  print('No')

Solution (Python):
import sys, math, itertools, collections, bisect 
input = lambda: sys.stdin.buffer.readline().rstrip().decode('utf-8') 
inf = float('inf') ;mod = 10**9+7 
mans = inf ;ans = 0 ;count = 0 ;pro = 1

a, b, c = map(int, input().split())
k = int(input())
for i in range(k):
    if a >= b:
        b *= 2
    elif b >= c:
        c *= 2
if a < b and b < c:
    print("Yes")
else:
    print("No")

Solution (Python):
a,b,c=map(int,input().split())
K=int(input())
for i in range(K):
  if c<=a:
    c=2*c
  elif b<=a:
    b=2*b
  elif c<=b:
    c=2*c
if a<b and b<c:
  print("Yes")
  exit()
else:
  print("No")

Solution (Python):
a, b, c = map(int, input().split())
k = int(input())


for _ in range(k):    
    if a >= b:
        b *= 2
    elif b >= c:
        c *= 2

if a < b and b < c:
    print('Yes')
else:
    print('No')

Solution (Python):
a,b,c = map(int, input().split())
k = int(input())

time = 0

while True:
  if time >= k:
    print("No")
    break
    
  if a >= b:
    b *= 2
  elif b >= c:
    c *= 2
  time += 1
  
  if a < b and b < c:
    print("Yes")
    break

Solution (Python):
def main():
    A,B,C = map(int,input().split())
    K = int(input())
    
    for k in range(K):
        if A >= B:
            B *= 2
        elif B >= C:
            C *= 2
            
    if A < B and B < C:
        print('Yes')
    else:
        print('No')
    
if __name__ == '__main__':
    main()

Solution (Python):
A,B,C=map(int,input().split())
K=int(input())

for i in range(K):
  if A>=B:
    B*=2
  elif B>=C:
    C*=2

if A<B and B<C:
  print("Yes")
else:
  print("No")

Solution (Python):
r, g, b = map(int, input().split())
k = int(input())

def e(r, g, b):
    return g > r and b > g

from itertools import product
for pp in product([0, 1, 2], repeat=k):
    rr = r
    gg = g
    bb = b
    for p in pp:
        if p == 0:
            rr *= 2
        elif p == 1:
            gg *= 2
        else:
            bb *= 2
    if e(rr, gg, bb):
        print('Yes')
        break
else:
    print('No')

Solution (Python):
a, b, c = map(int,input().split())
k = int(input())
count = 0

while b <= a:
    b *= 2
    count += 1

while c <= b:
    c *= 2
    count += 1

if count <= k:
    print("Yes")
else:
    print("No")

Solution (Python):
A, B, C = map(int, input().split())
K = int(input())
while K > 0:
    if A >= B:
        B *= 2
        K -= 1

    if K <= 0:
        break

    if B >= C:
        C *= 2
        K -= 1

    if A < B < C:
        break

if A < B < C:
    print("Yes")
else:
    print("No")

Solution (Python):
a, b, c = map(int, input().split())
k = int(input())
l = 0
while a >= b:
    b *= 2
    l += 1
while b >= c:
    c *= 2
    l += 1
if k >= l:
    print("Yes")
else:
    print("No")