G = [0] * 4
for i in range(3):
    a, b = map(int, input().split())
    a -= 1
    b -= 1
    G[a] += 1
    G[b] += 1

for i in range(4):
    if G[i] == 3:
        print('NO')
        exit()

print('YES') G = [0] * 4 G [0] * 4 [0] 0 4 for i in range(3):
    a, b = map(int, input().split())
    a -= 1
    b -= 1
    G[a] += 1
    G[b] += 1 i range(3) range 3 a, b = map(int, input().split()) a map(int, input().split()) map int input().split() ().split () input split b a -= 1 a 1 b -= 1 b 1 G[a] += 1 G[a] G a 1 G[b] += 1 G[b] G b 1 for i in range(4):
    if G[i] == 3:
        print('NO')
        exit() i range(4) range 4 if G[i] == 3:
        print('NO')
        exit() G[i] == 3 G[i] G i 3 print('NO') print 'NO' exit() exit print('YES') print 'YES' b -= 1 1 b a, b = map(int, input().split()) map(int, input().split()) a G = [0] * 4 [0] * 4 G b = map(int, input().split()) map(int, input().split()) b a -= 1 1 a
G = [0] * 4
for i in range(3):
    a, b = map(int, input().split())
    a -= 1
    b -= 1
    G[a] += 1
    G[b] += 1

for i in range(4):
    if G[i] == 3:
        print('NO')
        exit()

print('YES')
