from itertools import permutations as perm D = list(map(int, input().split())) def check(a, b, c): if a == b or b == c or a == c: return False return max(a, b, c) == b or min(a, b, c) == b for x in perm(D): if not (x[0]< x[2] < x[4] < x[6] and x[1] < x[3] < x[5]): continue for i in range(5): a, b, c = x[i:i+3] if not check(a, b, c): break else: print('YES') exit() print('NO')