有趣的思维题,排序后遍历一遍田忌的马即可,贪心算法,始终让刚好能跑赢齐王的马上场:)

l1 = list(sorted(list(map(int,input().split()))))
l2 = list(sorted(list(map(int,input().split()))))
cnt = 0
for i in range(3):
    if l2[i] > l1[cnt]:
        cnt += 1
print("Yes" if cnt >= 2 else "No")