def f(L): if (L[0] < L[1] > L[2] or L[0] > L[1] < L[2]) and (L[0] != L[2]): return True return False A = list(map(int, input().split())) B = list(map(int, input().split())) for i in range(3): for j in range(3): A[i],B[j] = B[j],A[i] if f(A) and f(B): exit(print('Yes')) A[i],B[j] = B[j],A[i] print('No')