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

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

if max(ab) >= 3:
    print('NO')
else:
    print('YES')
