import sys input = sys.stdin.readline from collections import * def nand(x, y): return 1^(x&y) def f(l): return nand(nand(nand(l[0], l[1]), l[2]), nand(nand(l[3], l[4]), l[5])) == 1 A = list(input().split()) for S in range(1<<6): l = [] for i in range(6): l.append((S>>i)&1) ok = True for i in range(6): for j in range(6): if A[i]==A[j] and l[i]!=l[j]: ok = False if not ok: continue if f(l): exit(print('YES')) print('NO')