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

for i in range(3):
    for j in range(3):
        Ac = A[:]
        Bc = B[:]
        Ac[i], Bc[j] = Bc[j], Ac[i]
        if Ac[0] != Ac[1] and Ac[1] != Ac[2] and Ac[2] != Ac[0]:
            if Bc[0] != Bc[1] and Bc[1] != Bc[2] and Bc[2] != Bc[0]:
                if Ac.index(min(Ac)) == 1 or Ac.index(max(Ac)) == 1:
                    if Bc.index(min(Bc)) == 1 or Bc.index(max(Bc)) == 1:
                        print("Yes")
                        exit()
print("No")