def nand(a,b):
    return not (a & b)
p = list(map(int,input().split()))
n = len(set(p))
p2 = list(set(p))
from collections import defaultdict
import sys
for i in range(1 << n):
    d = defaultdict(int)
    for j in range(n):
        if (1 << j) & i:
            d[p2[j]] = 1
    if nand(nand(nand(d[p[0]],d[p[1]]),d[p[2]]),nand(nand(d[p[3]],d[p[4]]),d[p[5]])):
        sys.exit(print("YES"))
        
print("NO")