T = [0 for _ in range(4)]
for i in range(3):
    a, b = map(int, input().split())
    T[a - 1] += 1
    T[b - 1] += 1
if max(T) == 3:
    print('NO')
else:
    print('YES') 0 for _ in range(4) for _ in range(4) _ range(4) range 4 for _ in range(4) 0 T = [0 for _ in range(4)] T [0 for _ in range(4)] for i in range(3):
    a, b = map(int, input().split())
    T[a - 1] += 1
    T[b - 1] += 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 T[a - 1] += 1 T[a - 1] T a - 1 a 1 1 T[b - 1] += 1 T[b - 1] T b - 1 b 1 1 if max(T) == 3:
    print('NO')
else:
    print('YES') max(T) == 3 max(T) max T 3 print('NO') print 'NO' print('YES') print 'YES' b = map(int, input().split()) map(int, input().split()) b T = [0 for _ in range(4)] [0 for _ in range(4)] T a, b = map(int, input().split()) map(int, input().split()) a
T = [0 for _ in range(4)]
for i in range(3):
    a, b = map(int, input().split())
    T[a - 1] += 1
    T[b - 1] += 1
if max(T) == 3:
    print('NO')
else:
    print('YES')