#%%
machi = [0, 0, 0, 0]
for _ in range(3):
    a, b = map(int, input().split())
    machi[a-1] += 1
    machi[b-1] += 1

for m in machi:
    if m == 3:
        import sys
        print('NO')
        sys.exit()

print('YES') machi = [0, 0, 0, 0] machi [0, 0, 0, 0] 0 0 0 0 for _ in range(3):
    a, b = map(int, input().split())
    machi[a-1] += 1
    machi[b-1] += 1 _ range(3) range 3 a, b = map(int, input().split()) a map(int, input().split()) map int input().split() ().split () input split b machi[a-1] += 1 machi[a-1] machi a-1 a 1 1 machi[b-1] += 1 machi[b-1] machi b-1 b 1 1 for m in machi:
    if m == 3:
        import sys
        print('NO')
        sys.exit() m machi if m == 3:
        import sys
        print('NO')
        sys.exit() m == 3 m 3 import sys sys print('NO') print 'NO' sys.exit() sys.exit sys exit print('YES') print 'YES' machi = [0, 0, 0, 0] [0, 0, 0, 0] machi b = map(int, input().split()) map(int, input().split()) b a, b = map(int, input().split()) map(int, input().split()) a
#%%
machi = [0, 0, 0, 0]
for _ in range(3):
    a, b = map(int, input().split())
    machi[a-1] += 1
    machi[b-1] += 1

for m in machi:
    if m == 3:
        import sys
        print('NO')
        sys.exit()

print('YES')