A = input().split() dic = {s:i for i, s in enumerate(sorted(set(A)))} A = [dic[a] for a in A] n = len(A) def nand(x, y): if x and y: return False else: return True def ok(P): x = nand(P[0], P[1]) x = nand(x, P[1]) y = nand(P[3], P[4]) y = nand(y, P[5]) return nand(x, y) for bit in range(1 << n): B = [bit >> a & 1 for a in A] if ok(B): print("YES") exit() print("NO")