import copy A = list(map(int,input().split())) B = list(map(int,input().split())) def check(X): if X[0] == X[1] or X[1] == X[2] or X[2] == X[0]: return False if X[0] < X[1] and X[1] > X[2]: return True if X[0] > X[1] and X[1] < X[2]: return True return False for i in range(3): for j in range(3): AA = copy.copy(A) BB = copy.copy(B) AA[i],BB[j] = BB[j],AA[i] if check(AA) and check(BB): print("Yes");exit() print("No")