from sys import stdin
from itertools import groupby

li = [list(map(int,stdin.readline().rstrip().split())) for _ in range(3)]
lis = []
for i in range(3):
    for j in range(2):
        lis.append(li[i][j])
lis.sort()
lin = []
for key, value in groupby(lis):
    lin.append(len(list(value)))
lin.sort()
if lin == [1,1,2,2]:
    print("YES")
else:
    print("NO") from sys import stdin from itertools import groupby list(map(int,stdin.readline().rstrip().split())) for _ in range(3) for _ in range(3) _ range(3) range 3 for _ in range(3) list(map(int,stdin.readline().rstrip().split())) list map(int,stdin.readline().rstrip().split()) map int stdin.readline().rstrip().split() stdin.readline().rstrip().split stdin.readline().rstrip() stdin.readline().rstrip stdin.readline() stdin.readline stdin readline rstrip split li = [list(map(int,stdin.readline().rstrip().split())) for _ in range(3)] li [list(map(int,stdin.readline().rstrip().split())) for _ in range(3)] lis = [] lis [] for i in range(3):
    for j in range(2):
        lis.append(li[i][j]) i range(3) range 3 for j in range(2):
        lis.append(li[i][j]) j range(2) range 2 lis.append(li[i][j]) lis.append lis append li[i][j] [i] li i j lis.sort() lis.sort lis sort lin = [] lin [] for key, value in groupby(lis):
    lin.append(len(list(value))) key value groupby(lis) groupby lis lin.append(len(list(value))) lin.append lin append len(list(value)) len list(value) list value lin.sort() lin.sort lin sort if lin == [1,1,2,2]:
    print("YES")
else:
    print("NO") lin == [1,1,2,2] lin [1,1,2,2] 1 1 2 2 print("YES") print "YES" print("NO") print "NO" lin = [] [] lin lis = [] [] lis li = [list(map(int,stdin.readline().rstrip().split())) for _ in range(3)] [list(map(int,stdin.readline().rstrip().split())) for _ in range(3)] li
from sys import stdin
from itertools import groupby

li = [list(map(int,stdin.readline().rstrip().split())) for _ in range(3)]
lis = []
for i in range(3):
    for j in range(2):
        lis.append(li[i][j])
lis.sort()
lin = []
for key, value in groupby(lis):
    lin.append(len(list(value)))
lin.sort()
if lin == [1,1,2,2]:
    print("YES")
else:
    print("NO")