import sys from itertools import permutations def debug(x, table): for name, val in table.items(): if x is val: print('DEBUG:{} -> {}'.format(name, val), file=sys.stderr) return None def is_kadomatu(a): return a[0] != a[2] and (a[0] - a[1])*(a[2] - a[1]) > 0 def solve(): Ds = [int(i) for i in input().split()] for line in permutations(Ds): for i in range(7 - 2): if not is_kadomatu((line[i], line[i + 1], line[i + 2])): break elif not(line[0] < line[2] < line[4] < line[6] and line[1] < line[3] < line[5]): break else: print('YES') # debug(line, locals()) return print('NO') if __name__ == '__main__': solve()