num1 = [int(x) for x in str(input()).split()] num2 = [int(x) for x in str(input()).split()] oldnum1 = [int(x) for x in num1] oldnum2 = [int(x) for x in num2] num1[1] = oldnum2[1] num2[1] = oldnum1[1] if len(list(set(num1))) != len(num1): print("Yes") elif num1.index(min(num1)) == 1 or num1.index(max(num1)) == 1 and num1.index(min(num1)) == 2 or num1.index(max(num1)) == 2 : print("Yes") else: print("No")