#%%
a = [0] * 3
b = [0] * 3
c = []
d = [0] * 3

for i in range(3):
    a[i], b[i] = map(int, input().split())
    c.append(a[i])
    c.append(b[i])
    d[i] = ''.join(str(a[i])+str(b[i]))
    if a[i] == b[i] :
        flag = False

flag = True

if 1 <= c.count(1) <= 2 and 1 <= c.count(2) <= 2 and 1 <= c.count(3) <= 2 and 1 <= c.count(4) <= 2:
     pass
else:
    flag = False

if len(list(set(d))) == 3:
    pass
else:
    flag = False

if flag:
    print('YES')
else:
    print('NO') a = [0] * 3 a [0] * 3 [0] 0 3 b = [0] * 3 b [0] * 3 [0] 0 3 c = [] c [] d = [0] * 3 d [0] * 3 [0] 0 3 for i in range(3):
    a[i], b[i] = map(int, input().split())
    c.append(a[i])
    c.append(b[i])
    d[i] = ''.join(str(a[i])+str(b[i]))
    if a[i] == b[i] :
        flag = False i range(3) range 3 a[i], b[i] = map(int, input().split()) a[i] a i map(int, input().split()) map int input().split() ().split () input split b[i] b i c.append(a[i]) c.append c append a[i] a i c.append(b[i]) c.append c append b[i] b i d[i] = ''.join(str(a[i])+str(b[i])) d[i] d i ''.join(str(a[i])+str(b[i])) ''.join '' join str(a[i])+str(b[i]) str(a[i]) str a[i] a i str(b[i]) str b[i] b i if a[i] == b[i] :
        flag = False a[i] == b[i] a[i] a i b[i] b i flag = False flag False flag = True flag True if 1 <= c.count(1) <= 2 and 1 <= c.count(2) <= 2 and 1 <= c.count(3) <= 2 and 1 <= c.count(4) <= 2:
     pass
else:
    flag = False 1 <= c.count(1) <= 2 and 1 <= c.count(2) <= 2 and 1 <= c.count(3) <= 2 and 1 <= c.count(4) <= 2 1 <= c.count(1) <= 2 and 1 <= c.count(2) <= 2 and 1 <= c.count(3) <= 2 1 <= c.count(1) <= 2 and 1 <= c.count(2) <= 2 1 <= c.count(1) <= 2 1 <= c.count(1) 1 c.count(1) c.count c count 1 2 1 <= c.count(2) <= 2 1 <= c.count(2) 1 c.count(2) c.count c count 2 2 1 <= c.count(3) <= 2 1 <= c.count(3) 1 c.count(3) c.count c count 3 2 1 <= c.count(4) <= 2 1 <= c.count(4) 1 c.count(4) c.count c count 4 2 flag = False flag False if len(list(set(d))) == 3:
    pass
else:
    flag = False len(list(set(d))) == 3 len(list(set(d))) len list(set(d)) list set(d) set d 3 flag = False flag False if flag:
    print('YES')
else:
    print('NO') flag print('YES') print 'YES' print('NO') print 'NO' flag = False False flag flag = False False flag d = [0] * 3 [0] * 3 d b = [0] * 3 [0] * 3 b flag = False False flag a = [0] * 3 [0] * 3 a flag = True True flag c = [] [] c
#%%
a = [0] * 3
b = [0] * 3
c = []
d = [0] * 3

for i in range(3):
    a[i], b[i] = map(int, input().split())
    c.append(a[i])
    c.append(b[i])
    d[i] = ''.join(str(a[i])+str(b[i]))
    if a[i] == b[i] :
        flag = False

flag = True

if 1 <= c.count(1) <= 2 and 1 <= c.count(2) <= 2 and 1 <= c.count(3) <= 2 and 1 <= c.count(4) <= 2:
     pass
else:
    flag = False

if len(list(set(d))) == 3:
    pass
else:
    flag = False

if flag:
    print('YES')
else:
    print('NO')