def solve(a, b):
    v = [0,0,0,0]
    for i in range(3):
        v[a[i]-1] += 1
        v[b[i]-1] += 1
    return "YES" if sorted(v) == [1,1,2,2] else "NO"

a = [0]*3
b = [0]*3
for i in range(3):
    a[i], b[i] = map(int, input().split())
print(solve(a, b)) def solve(a, b):
    v = [0,0,0,0]
    for i in range(3):
        v[a[i]-1] += 1
        v[b[i]-1] += 1
    return "YES" if sorted(v) == [1,1,2,2] else "NO" solve v = [0,0,0,0] v [0,0,0,0] 0 0 0 0 for i in range(3):
        v[a[i]-1] += 1
        v[b[i]-1] += 1
     i range(3) range 3 v[a[i]-1] += 1 v[a[i]-1] v a[i]-1 a[i] a i 1 1 v[b[i]-1] += 1 v[b[i]-1] v b[i]-1 b[i] b i 1 1 return "YES" if sorted(v) == [1,1,2,2] else "NO" "YES" if sorted(v) == [1,1,2,2] else "NO" sorted(v) == [1,1,2,2] sorted(v) sorted v [1,1,2,2] 1 1 2 2 "YES" "NO" a a b b a = [0]*3 a [0]*3 [0] 0 3 b = [0]*3 b [0]*3 [0] 0 3 for i in range(3):
    a[i], b[i] = map(int, input().split()) 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 print(solve(a, b)) print solve(a, b) solve a b def solve(a, b):
    v = [0,0,0,0]
    for i in range(3):
        v[a[i]-1] += 1
        v[b[i]-1] += 1
    return "YES" if sorted(v) == [1,1,2,2] else "NO" def solve(a, b):
    v = [0,0,0,0]
    for i in range(3):
        v[a[i]-1] += 1
        v[b[i]-1] += 1
    return "YES" if sorted(v) == [1,1,2,2] else "NO" solve b = [0]*3 [0]*3 b a = [0]*3 [0]*3 a
def solve(a, b):
    v = [0,0,0,0]
    for i in range(3):
        v[a[i]-1] += 1
        v[b[i]-1] += 1
    return "YES" if sorted(v) == [1,1,2,2] else "NO"

a = [0]*3
b = [0]*3
for i in range(3):
    a[i], b[i] = map(int, input().split())
print(solve(a, b))