def main(): #ι–€ζΎεˆ— def kadomatsu(x): if (x[0] < x[1] > x[2] or x[0] > x[1] < x[2] and x[0] != x[2]): return True else: 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 = a.copy() B = b.copy() A[i], B[j] = B[j], A[i] #print(A, B) if kadomatsu(A) and kadomatsu(B): exit(print('Yes')) print('No') if __name__ == '__main__': main()